Skip to content

Commit

Permalink
fix: replace displaylines with gather*
Browse files Browse the repository at this point in the history
Fixes #28
  • Loading branch information
AllanChain committed May 1, 2024
1 parent 3aa622d commit 352f2e9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ export async function openPopup(

let done = false
const wrapLaTeX = (latex: string) => {
// HACK: `lines` environment is not supported by KaTeX.
// It was replaced by `\displaylines` in 0.98.5 which is also not supported.
if (latex.startsWith('\\begin{lines}')) {
latex = latex.replaceAll('{lines}', '{gather}')
// HACK: `\displaylines` is not supported by KaTeX.
const matchLines = latex.match(/^\{\\displaylines(?<content>.*)\}$/s)
if (matchLines !== null && matchLines.groups !== undefined) {
latex = `\\begin{gather*}${matchLines.groups.content}\\end{gather*}`
}
if (delim !== '$' && logseq.settings?.preferMultiline) {
latex = latex
Expand Down

0 comments on commit 352f2e9

Please sign in to comment.