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
Currently it is not possible to know which text was parsed to ThematicBreak. Was it --- or was it *** ? This information is lost when parsing mark up text in this library.
In order to enable the user of the library to differentiate, it would be useful to keep the text literal in a variable of ThematicBreak. So one could do (in Kotlin)
// prints the original text that was parsed
fun print(node: Node): String {
return when (node) {
is ThematicBreak -> node.literal
...
}
}
The same issue exists with HardLineBreak where two or more line breaks are reduced to one HardLineBreak-element. Adding a literal variable would enable to reconstruct the original text that was parsed and one could check how many line breaks the text originally had.
More generally, this feature request goes into the direction of enabling a bijection between the text and its parsed representation. I am not sure if a full bijection makes sense, but for the two node types of ThematicBreak and HardLineBreak it definitely does.
The text was updated successfully, but these errors were encountered:
Thanks, done for ThematicBreak. Can you create a separate issue for HardLineBreak please? I'm not sure what you mean by "The same issue exists with HardLineBreak where two or more line breaks are reduced to one HardLineBreak-element".
On printing the original text that was parsed, have you seen this recently merged pull request?:
Currently it is not possible to know which text was parsed to ThematicBreak. Was it --- or was it *** ? This information is lost when parsing mark up text in this library.
In order to enable the user of the library to differentiate, it would be useful to keep the text literal in a variable of ThematicBreak. So one could do (in Kotlin)
The same issue exists with HardLineBreak where two or more line breaks are reduced to one HardLineBreak-element. Adding a literal variable would enable to reconstruct the original text that was parsed and one could check how many line breaks the text originally had.
More generally, this feature request goes into the direction of enabling a bijection between the text and its parsed representation. I am not sure if a full bijection makes sense, but for the two node types of ThematicBreak and HardLineBreak it definitely does.
The text was updated successfully, but these errors were encountered: