Loading generateBaseline/pandocFilter.py +13 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,10 @@ def replaceTableCaptions(progress:Progress, mdLines:list[str]) -> list[str]: _lines:list[str] = [] for line in mdLines: matches = re.findall(tableregex, line) _inCodeBlock = checkInCodeBlock(line) if _inCodeBlock: _lines.append(line) continue if matches: # move the caption to the beginning of the table and add a "Table:" prefix _idx = len(_lines) - 1 Loading Loading @@ -121,6 +125,10 @@ def replaceFigureCaptions(progress:Progress, mdLines:list[str]) -> list[str]: _lines:list[str] = [] for line in mdLines: matches = re.findall(figureregex, line) _inCodeBlock = checkInCodeBlock(line) if _inCodeBlock: _lines.append(line) continue if matches: # Replace the previous figure markdown name with the captions _idx = len(_lines) - 1 Loading @@ -147,6 +155,11 @@ def replaceFiguresPathSvgToPng(progress: Progress, mdLines: list[str]) -> list[s _lines: list[str] = [] for line in mdLines: matches = re.findall(figurePathRegex, line) _inCodeBlock = checkInCodeBlock(line) if _inCodeBlock: _lines.append(line) continue if matches: # Replace figure path to png _lines.append(re.sub(r'\.svg', f'.png', line)) Loading Loading
generateBaseline/pandocFilter.py +13 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,10 @@ def replaceTableCaptions(progress:Progress, mdLines:list[str]) -> list[str]: _lines:list[str] = [] for line in mdLines: matches = re.findall(tableregex, line) _inCodeBlock = checkInCodeBlock(line) if _inCodeBlock: _lines.append(line) continue if matches: # move the caption to the beginning of the table and add a "Table:" prefix _idx = len(_lines) - 1 Loading Loading @@ -121,6 +125,10 @@ def replaceFigureCaptions(progress:Progress, mdLines:list[str]) -> list[str]: _lines:list[str] = [] for line in mdLines: matches = re.findall(figureregex, line) _inCodeBlock = checkInCodeBlock(line) if _inCodeBlock: _lines.append(line) continue if matches: # Replace the previous figure markdown name with the captions _idx = len(_lines) - 1 Loading @@ -147,6 +155,11 @@ def replaceFiguresPathSvgToPng(progress: Progress, mdLines: list[str]) -> list[s _lines: list[str] = [] for line in mdLines: matches = re.findall(figurePathRegex, line) _inCodeBlock = checkInCodeBlock(line) if _inCodeBlock: _lines.append(line) continue if matches: # Replace figure path to png _lines.append(re.sub(r'\.svg', f'.png', line)) Loading