Closed ggrossetie closed 3 years ago
That makes sense! Mind sending a pull request for that too? ;-)
As mentioned by @azu we can use textlint-util-to-string
:
I always use textlint-util-to-string for extracting text content from TxtParentNode. It picks each children nodes's value and joins these. (It aims to pick values that are displayed as rendering result)
https://github.com/opendevise/textlint-plugin-asciidoc/issues/1#issuecomment-753420572
@sapegin Do you have any preference?
Currently, we are using a regular expression to extract the header text from the raw value:
https://github.com/sapegin/textlint-rule-title-case/blob/89e4cd698fd194a27a7eb54a0478e77332326cbb/index.js#L6
The issue is that the format
# Title
is specific to Markdown and won't work when using with an AsciiDoc document.We can either update the regular expression to use either
#
or=
but I think it would be better to extract the header text from the children no?