Put $ or $$ around math in csljson output.

Closes #9616.
This commit is contained in:
John MacFarlane
2024-04-01 12:54:12 -07:00
parent 6ee03849aa
commit c29c18a003
2 changed files with 18 additions and 1 deletions
+2 -1
View File
@@ -71,7 +71,8 @@ fromInline (Code _ t) = CslText t
fromInline Space = CslText " "
fromInline SoftBreak = CslText " "
fromInline LineBreak = CslText "\n"
fromInline (Math _ t) = CslText t
fromInline (Math InlineMath t) = CslText $ "$" <> t <> "$"
fromInline (Math DisplayMath t) = CslText $ "$$" <> t <> "$$"
fromInline (RawInline _ _) = CslEmpty
fromInline (Link _ ils _) = fromInlines ils
fromInline (Image _ ils _) = fromInlines ils
+16
View File
@@ -0,0 +1,16 @@
```
% pandoc -f bibtex -t csljson -s
@MISC {3252037,
TITLE = {Isomorphism between projective varieties $\mathbf{P}^{1}$ and a conic in $\mathbf{P}^{2}$},
URL = {https://math.stackexchange.com/q/3252037}
}
^D
[
{
"URL": "https://math.stackexchange.com/q/3252037",
"id": "3252037",
"title": "Isomorphism between projective varieties $\\mathbf{P}^{1}$ and a conic in $\\mathbf{P}^{2}$",
"type": ""
}
]
```