-
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Problem
textlint-rule-ja-no-mixed-period points out "no period" errors in tabular environments.
Cause
\begin{table}[]
\begin{tabular}{cc}
This is & a table
\end{tabular}
\end{table}This LaTeX code is converted to an AST like below.
Since textlint-rule-ja-no-mixed-period treats the last Str node of a Paragraph node as the end of a sentence, converting a tabular environment to these nodes causes an unexpected error.
{
"type": "Document",
"raw": "...",
"range": [],
"loc": {},
"children": [
{
"loc": {},
"range": [],
"raw": "cc}\n This is & a table",
"type": "Paragraph",
"children": [
{
"loc": {},
"range": [],
"raw": "cc",
"type": "Str",
"value": "cc"
},
{
"loc": {},
"range": [],
"raw": "}\n ",
"type": "Html",
"value": "}\n "
},
{
"loc": {},
"range": [],
"raw": "This",
"type": "Str",
"value": "This"
},
// ...
]
}
]
}Solution
textlint-plugin-review seems to treat each item in a table as a ListItem node.
We can also wrap Str nodes into ListItem nodes.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
