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

Exclude code blocks from reStructuredText #20

Closed
AlexMAS opened this issue Jun 8, 2017 · 4 comments
Closed

Exclude code blocks from reStructuredText #20

AlexMAS opened this issue Jun 8, 2017 · 4 comments

Comments

@AlexMAS
Copy link

AlexMAS commented Jun 8, 2017

Hello!

Today I tried to exclude code blocks from the analysis using ignoreRegExps and expression "/\\s{4,}.*/g". Here is my configuration:

{
    "language": "en",
    "documentTypes": [
        "restructuredtext",
        "markdown",
        "latex",
        "plaintext"
    ],
    "groupDictionaries": true,
    "statusBarIndicator": true,
    "suggestionsInHints": true,
    "ignoreWords": [],
    "ignoreRegExps": [
        "/\\s{4,}.*/g"
    ],
    "ignoreFiles": [
        "**/.gitignore",
        "**/.spellignore"
    ]
}

After few iterations I haven't gotten success and I need your help again. :) I also tested my expression here https://regex101.com/r/GJXToz/1 and it works fine (I think).

Thanks.

@bartosz-antosik
Copy link
Owner

'ignoreRegExps' as I hope is explained in the README works only on words/compound phrases separated by the parser for appropriate class of documents (e.g. CamelCase before and after splitting). So it would not remove a whole code block.

I do not have a slight idea about reStructuredText so I had a glance at some quick reference and have doubts: the regular expression you propose, would it not remove from spelling Block Quotes as well?

@AlexMAS
Copy link
Author

AlexMAS commented Jun 8, 2017

Yes, you're right, my regular expression ignores Block Quotes. There is a reason why I decided do it via ignoreRegExps and did't ask you add it as the rule. Firstly, in my project I don't use Block Quotes. I also understand that support all features of reStructuredText can be difficult task and take quite enough time. So the above expression could help me for a while.

@bartosz-antosik
Copy link
Owner

Let me please meditate on this a moment! I have already implemented this code-block elimination but it does what I have mentioned above to Block Quotes and I am not fully happy with the solution.

@bartosz-antosik
Copy link
Owner

I have implemented this and think it will stay inside markdown parser in 'restructuredtext' document type filter branch for good: https://regex101.com/r/GJXToz/2 ;-)

Will be available in version 1.0.22 in a moment. Let me know if it works or maybe I have forgotten something (e.g. do I understand code-block|highlight placement correctly?)

bartosz-antosik pushed a commit that referenced this issue Jun 9, 2017
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

2 participants