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
OS - MacOS
Install Method - Homebrew
Vale Version - 2.25.2
Describe the bug / provide steps to reproduce it
I've got a real head scratcher here @jdkato, hoping you can help me think through what might be going on here.
I'm noticing a really strange bug where a <pre> tag nested within a <li> tag is flagging tokens within the <pre> scope, but only if that same token occurs prior to the <pre> tag and within the <li>.
Here's an example demonstrating what I mean -- let's say I'm running Vale over the following content and I have a rule configured which flags the usage of "TAM". In this scenario, I have no specific scopes set for this rule, but I am using the default skippedScopes to ignore the pre scope in my vale.ini:
{
"content": "<div><li>To calculate the TAM, first do this<pre>x = 1\ny = 1\nz = x + y\nnow that have z, we can find the value\nTAM would be equal to z</pre></li></div>"
}
The response I would expect would be that the first usage of "TAM" gets flagged (the one within the <li> but prior to the <pre>).
However, this is the response that is getting returned is flagging the usage of "TAM" within the <pre> tag and NOT the one within the <li> tag but prior to the <pre>:
It's super strange to me that it's flagging one and not the other. What's even more strange is that if the first usage of "TAM" did not exist (the one outside the <pre> tag), then the second usage of "TAM" (the one inside the <pre> tag) would not get flagged.
In summary, to reproduce the following needs to be true:
The <pre> tag is nested within a <li> tag
Use the offending token outside the <pre> tag but inside the <li> tag
Re-use the offending token inside the <pre> tag too
And the result will be that the offending token gets flagged within the <pre> tag but not elsewhere. Interestingly, I've also noticed that this only occurs when the offending token is on the last line of the <pre> tag. For example:
{
"content": "<div><li>To calculate the TAM, first do this<pre>x = 1\ny = 1\nz = x + y\nnow that have TAM z, we can find the value\nwould be equal to z</pre></li></div>"
}
The above input works exactly as expected, flagging the first usage of "TAM", because the usage of "TAM" inside the <pre> tag is not in the last sentence.
For reference, here is the skippedScopes I have configured: SkippedScopes = alt, script, style, pre, figure.
The text was updated successfully, but these errors were encountered:
Hey @jdkato thanks for getting back to me. To be clear, the part I run the style checks on is only the value of the content key, which is valid HTML:
<div><li>To calculate the TAM, first do this<pre>x = 1\ny = 1\nz = x + y\nnow that have z, we can find the value\nTAM would be equal to z</pre></li></div>
Check for existing issues
Environment
OS - MacOS
Install Method - Homebrew
Vale Version - 2.25.2
Describe the bug / provide steps to reproduce it
I've got a real head scratcher here @jdkato, hoping you can help me think through what might be going on here.
I'm noticing a really strange bug where a
<pre>
tag nested within a<li>
tag is flagging tokens within the<pre>
scope, but only if that same token occurs prior to the<pre>
tag and within the<li>
.Here's an example demonstrating what I mean -- let's say I'm running Vale over the following content and I have a rule configured which flags the usage of "TAM". In this scenario, I have no specific scopes set for this rule, but I am using the default
skippedScopes
to ignore thepre
scope in myvale.ini
:The response I would expect would be that the first usage of "TAM" gets flagged (the one within the
<li>
but prior to the<pre>
).However, this is the response that is getting returned is flagging the usage of "TAM" within the
<pre>
tag and NOT the one within the<li>
tag but prior to the<pre>
:It's super strange to me that it's flagging one and not the other. What's even more strange is that if the first usage of "TAM" did not exist (the one outside the
<pre>
tag), then the second usage of "TAM" (the one inside the<pre>
tag) would not get flagged.In summary, to reproduce the following needs to be true:
<pre>
tag is nested within a<li>
tag<pre>
tag but inside the<li>
tag<pre>
tag tooAnd the result will be that the offending token gets flagged within the
<pre>
tag but not elsewhere. Interestingly, I've also noticed that this only occurs when the offending token is on the last line of the<pre>
tag. For example:The above input works exactly as expected, flagging the first usage of "TAM", because the usage of "TAM" inside the
<pre>
tag is not in the last sentence.For reference, here is the skippedScopes I have configured:
SkippedScopes = alt, script, style, pre, figure
.The text was updated successfully, but these errors were encountered: