mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 16:22:44 +00:00
Replace Regex Lookbehind with obnoxious workaround so Safari doesn't break
This commit is contained in:
@@ -384,8 +384,10 @@ const splitCells = (tableRow, count, prevRow = [])=>{
|
||||
return ` ${p1}`;
|
||||
}
|
||||
});
|
||||
tableRow = ` ${tableRow}`;
|
||||
|
||||
const cells = tableRow.split(/(?: \||(?<=\|)\|)(?=[^\|]|$)/g);
|
||||
// Split into cells. Contents are: no pipes unless escaped. Add any ending pipes; if not don't include ending space
|
||||
const cells = [...tableRow.matchAll(/(?:[^\|]+(?:\\\|)*)+(?:\|+(?=\|)|(?= \|))/g)].map((x)=>x[0]);
|
||||
let i = 0;
|
||||
|
||||
// First/last cell in a row cannot be empty if it has no leading/trailing pipe
|
||||
|
||||
Reference in New Issue
Block a user