Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vale on/off comments do not work on titles in RST #340

Open
mxsasha opened this issue Mar 17, 2021 · 3 comments
Open

Vale on/off comments do not work on titles in RST #340

mxsasha opened this issue Mar 17, 2021 · 3 comments

Comments

@mxsasha
Copy link

mxsasha commented Mar 17, 2021

This RST:

.. vale off

this text should be fine
------------------------

.. vale on

with a style that forbids the word "text", still generates an error:

 3:6  error  Use 'words' instead of 'text'  example-styles.example 

In my understanding, no error should be raised in this case.

With the exact same setup, this file (correctly) does not generate an error.

.. vale off

this text should be fine

.. vale on

Tested with .vale.ini as:

[*.{md,rst,txt,json}]
BasedOnStyles = example-styles

and the only style in example-styles being:

extends: substitution
message: Use '%s' instead of '%s'
level: error
swap:
  text: words

Seen on Mac OS 11.2.1, vale 2.9.1 installed through homebrew. It's a bit too complicated (and I don't know Go) to debug further on my own.

mxsasha added a commit to writethedocs/www that referenced this issue Mar 18, 2021
mxsasha added a commit to writethedocs/www that referenced this issue Mar 18, 2021
mxsasha added a commit to writethedocs/www that referenced this issue Mar 18, 2021
mxsasha added a commit to writethedocs/www that referenced this issue Mar 18, 2021
mxsasha added a commit to writethedocs/www that referenced this issue Mar 19, 2021
@jdkato
Copy link
Member

jdkato commented Mar 20, 2021

The problem here seems to be a bug with rst2html.

.. vale off

this text should be fine
------------------------

.. vale on

This text should be fine.

.. vale off

this text should be fine

.. vale on

If you run rst2html on the above file, you'll get

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.16: http://docutils.sourceforge.net/" />
<title>this text should be fine</title>
</head>
<body>
<div class="document" id="this-text-should-be-fine">
<h1 class="title">this text should be fine</h1>

<!-- vale off -->
<!-- vale on -->
<p>This text should be fine.</p>
<!-- vale off -->
<p>this text should be fine</p>
<!-- vale on -->
</div>
</body>
</html>

The vale off comment appears after the heading in the output, even though it appears before the heading in the input.

@RCheesley
Copy link

We have this issue as well in the Mautic docs, which causes our checks to fail as we need to use camel case where a part of the product is included in the heading.

@RCheesley
Copy link

I get a similar but maybe related issue with Ascii docs (in this case, Antora). I have some pages which relate to 'My Account' and so forth, so it's erroring on Google.FirstPerson, but I can't wrap the heading of the page in a Vale statement without getting a critical error:

Level 0 sections can only be used when doctype is book ascidoctor.js

plaindocs added a commit to stumblefiend/www that referenced this issue Jul 4, 2024
This may or may not work
See errata-ai/vale#340
plaindocs added a commit to writethedocs/www that referenced this issue Jul 9, 2024
* Combine api tool documentation and create basic doc structure.

* Update links to point to consolidated API document

* Employ technical writing best practices

* Add a link to API Blueprint

* Fix link syntax

* Fix build

* Turn vale off for "Apiary"

This may or may not work
See errata-ai/vale#340

* Revert "Turn vale off for "Apiary""

This reverts commit 7afc314.

* Add exception

* Update link text

---------

Co-authored-by: Sam Wright <samuel@plaindocs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@mxsasha @RCheesley @jdkato and others