Suppress inspection in Markdown

I have authored some Markdown for creating man pages via pandoc.  The results work great but I'm getting a few "Cannot resolve anchor #foo" that I'd like to suppress.  Technically, the anchors do exist as an HTML tag in the raw Markdown.  For example, I need to resort to such means because I want to link to a definition (linking to section headers is much simpler):

~~~

<a name="size-arguments"></a>*SIZE* arguments

: Some options take a *SIZE* argument. For convenience *SIZE* may be...

~~~

and later ...

~~~

See [*SIZE* arguments](#size-arguments) for more details.

~~~

Ideally, PyCharm would get this inspection right.  In the meantime, is there a way I can suppress this inspection per incident or document?  PyCharm doesn't offer an option here to insert a special comment to suppress these, though I'm hoping a manually inserted one would work ... if I knew what it would like I'd try that.  I'd rather not remove the file from my inspection scope since other inspections are still valuable.

5 comments
Comment actions Permalink

Have you tried to uncheck "Anchor reference problems" in HTML inspection settings?

0
Comment actions Permalink

That setting has no effect here.  Even if it did, it would not be my preference for the entire project.

0
Comment actions Permalink

Unfortunately there's no way to suppress the inspection per document (file). If I understand correctly, the main issue here is that PyCharm handles this specific inspection incorrectly, so I would suggest to submit it as a bug report to our issue tracker (https://youtrack.jetbrains.com/issues/PY), providing a more encompassing example and description.

UPDATE: My answer appears to be outdated. You can suppress inspections per file by using custom scopes: https://www.jetbrains.com/help/pycharm/scope.html#Scope.xml

So for anyone who was confused by my initial reply - I am sorry.

0
Comment actions Permalink

I'd like to add a related issue.

I've marked sections of a Markdown document as JavaScript (```javascript), and even though these are only small code fragments that aren't at all meant to be complete code, the Markdown document gets flagged for having JavaScript problems. It's nice to get the JavaScript formatting, but I certainly don't want JavaScript inspections at the same time!

0
Comment actions Permalink

@Kerry

You can define custom scopes to disable inspection only for specific files/folders: https://www.jetbrains.com/help/pycharm/scope.html#Scope.xml

My reply above was wrong, sorry about that.

0

Please sign in to leave a comment.