Comparing version 0.0.16 to 0.0.17
@@ -108,6 +108,7 @@ "use strict"; | ||
} | ||
const is_atom = (str) => (['(', ')', '[', ']', '{', '}'].includes(str)); | ||
res.args = [ | ||
{ type: 'atom', content: left }, | ||
{ type: is_atom(left) ? 'atom' : 'symbol', content: left }, | ||
body, | ||
{ type: 'atom', content: right } | ||
{ type: is_atom(right) ? 'atom' : 'symbol', content: right } | ||
]; | ||
@@ -114,0 +115,0 @@ break; |
@@ -126,3 +126,3 @@ "use strict"; | ||
// These pairs will be handled by Typst compiler by default. No need to add lr() | ||
if (["[]", "()", "{}"].includes(left.content + right.content)) { | ||
if (["[]", "()", "{}", "\\lfloor\\rfloor", "\\lceil\\rceil"].includes(left.content + right.content)) { | ||
this.append(left); | ||
@@ -129,0 +129,0 @@ this.append(body); |
{ | ||
"name": "tex2typst", | ||
"version": "0.0.16", | ||
"version": "0.0.17", | ||
"description": "JavaScript library for converting TeX code to Typst", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -104,6 +104,7 @@ // @ts-ignore | ||
} | ||
const is_atom = (str:string) => (['(', ')', '[', ']', '{', '}'].includes(str)); | ||
res.args = [ | ||
{ type: 'atom', content: left }, | ||
{ type: is_atom(left)? 'atom': 'symbol', content: left }, | ||
body, | ||
{ type: 'atom', content: right} | ||
{ type: is_atom(right)? 'atom': 'symbol', content: right} | ||
]; | ||
@@ -110,0 +111,0 @@ break; |
@@ -135,3 +135,3 @@ import { symbolMap } from "./map"; | ||
// These pairs will be handled by Typst compiler by default. No need to add lr() | ||
if (["[]", "()", "{}"].includes(left.content + right.content)) { | ||
if (["[]", "()", "{}", "\\lfloor\\rfloor", "\\lceil\\rceil"].includes(left.content + right.content)) { | ||
this.append(left); | ||
@@ -138,0 +138,0 @@ this.append(body); |
89269
2056