You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears to me that the list item c ends at the wrong position. It should be the same as the ending position of c1 instead of the current 6:3, which is the starting position of the block quote. This shall be compared with the list item b, which ends at 3:9 instead of 4:3.
This troubles me because I want to use this tool to format my markdown files. This will cause the program to wrongly identify a nonspread list to be a spread one, and add unintended empty lines between those list items.
Thus, I tried to figure out what happens, but I quickly got lost in the micromark source codes. As far as I understand, the micromark context pushes an exit event of the listUnordered container when it finds a line not belonging to the current list. But this occurs after it has touches the starting position of next container (i.e., the blockQuote container here). Then, it adjusts the position of the exit event through documentContinue function and some postprocesses. However, in this case, for whatever reason, when exiting the listUnordered container, the documentContinue function does not read a self.containerState._closeFlow marker and adjust the ending position of the previous container. And all the following position fixing works are not executed.
This is possibly caused by the fact that the notInCurrentItem function is not executed (or later reverted) when the list construct finds the next line is not another list item.
I did not know how to proceed now, so I need your help. Could you please let me know whether this is expected or not, and what is the minimal patch to adjust the ending position in the way I expect?
Actually I am trying to write a new micromark extension for more markdown extensions, but I won't bother you with the details because I find exactly the same thing occurs within the original micromark framework. Therefore, an easy fix without touching codes of the micromark is greatly appreciated, so that I can simply add a patch in my own repo.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! Thank you a lot for this excellent repo!
I recently encountered a seemingly incorrect behavior of this micromark repo but I do not know whether this is expected and/or how to avoid it.
If we are using remark to parse the following document:
with the following script:
we might get the following result: (some lines omitted)
It appears to me that the list item
cends at the wrong position. It should be the same as the ending position ofc1instead of the current6:3, which is the starting position of the block quote. This shall be compared with the list itemb, which ends at3:9instead of4:3.This troubles me because I want to use this tool to format my markdown files. This will cause the program to wrongly identify a nonspread list to be a spread one, and add unintended empty lines between those list items.
Thus, I tried to figure out what happens, but I quickly got lost in the micromark source codes. As far as I understand, the micromark context pushes an
exitevent of thelistUnorderedcontainer when it finds a line not belonging to the current list. But this occurs after it has touches the starting position of next container (i.e., theblockQuotecontainer here). Then, it adjusts the position of theexitevent throughdocumentContinuefunction and some postprocesses. However, in this case, for whatever reason, when exiting thelistUnorderedcontainer, thedocumentContinuefunction does not read aself.containerState._closeFlowmarker and adjust the ending position of the previous container. And all the following position fixing works are not executed.This is possibly caused by the fact that the
notInCurrentItemfunction is not executed (or later reverted) when the list construct finds the next line is not another list item.I did not know how to proceed now, so I need your help. Could you please let me know whether this is expected or not, and what is the minimal patch to adjust the ending position in the way I expect?
Actually I am trying to write a new micromark extension for more markdown extensions, but I won't bother you with the details because I find exactly the same thing occurs within the original micromark framework. Therefore, an easy fix without touching codes of the micromark is greatly appreciated, so that I can simply add a patch in my own repo.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions