Replies: 2 comments 1 reply
-
I would probably write this as a tengo script:
It'll get a little tricky tracking the current character position, but this is the only way I can think of doing this kind of check. I'm about to do this with code fences myself and this is how I'll aproach it. This script from Grafana actually iterates over the whole file, so that might be another way to go. So, break file into lines. Hope that helps. I haven't written this yet but like I said, I need this for markdown. |
Beta Was this translation helpful? Give feedback.
-
The following workes: https://github.com/openSUSE/suse-vale-styleguide/blob/main/asciidoc/LongScreen.yml and https://github.com/openSUSE/suse-vale-styleguide/blob/main/docbook/LongScreen.yml |
Beta Was this translation helpful? Give feedback.
-
Hi
i'm constructing a new rule that will detect lines inside Docbook's element that are longer than 80 characters.
I've successfully detected the starting version
<screen>some long sentence
and ending versionsome long sentence</screen>
and one-liner<screen>some long sentence</screen>
.But if the content of the
<screen/>
element is multiline text, i dont know how to construct the rule, help much appreciated.Here is the rule file https://github.com/openSUSE/suse-vale-styleguide/blob/e83b27903567c8cc69fc6a73617b05b0f7603000/docbook/LongScreen.yml
Here is the test file https://github.com/openSUSE/suse-vale-styleguide/blob/e83b27903567c8cc69fc6a73617b05b0f7603000/tests/LongScreen-bad.xml
The middle line of the following example should be matched as well
Beta Was this translation helpful? Give feedback.
All reactions