commonmark.js icon indicating copy to clipboard operation
commonmark.js copied to clipboard

Expose read-write accessors.

Open tmpfs opened this issue 9 years ago • 2 comments

For lastLineBlank, htmlBlockType and a data property which allows AST consumers to associate arbitrary data with an AST node.

tmpfs avatar Mar 29 '16 05:03 tmpfs

I understand about data, but the others are internal state for the parser; why would users need to alter them?

jgm avatar Aug 01 '17 23:08 jgm

I need to know the type of html block type under quite a few scenarios, IIRC particularly to determine if a block is a processing instruction or not. It just feels wrong to be accessing the private variables. I forget for lastLineBlank but i think it was to do with lists at the end of partials and determining whether i need to add and additional line or not. It has been a long time so i would have to read the code again...

tmpfs avatar Aug 02 '17 03:08 tmpfs