SublimeLinter/SublimeLinter-html-tidy

Ignore match for html tidy is not working to ignore '<' + '/' + letter not allowed here

burdiyan opened this issue · 4 comments

I'm trying to set html tidy to ignore this error within script tag. Not working even ignoring just "not allowed here". The error continue appearing. Any other error can be ignored successfully, but not this one. Don't know what is wrong.

I use the underscore template as inline script in my html with type of text/template. I also have modified HTML language file to treat script with this type as html (it is highlighted as HTML).

But the linter is showing the warning that "</" can't be used within script tags.

This is the code:

<script id="contactTemplate" type="text/template">
        <img src="<%= photo %>" alt="<%= name %>" />
        <h1><%= name %><span><%= type %></span></h1>
        <div><%= address %></div>
        <dl>
            <dt>Tel:</dt><dd><%= tel %></dd>
            <dt>Email:</dt><dd><a href="mailto:<%= email %>"><%= email %></a></dd>
        </dl>
</script>

And this is the error:

'<' + '/' + letter not allowed here;

I'm ignoring "not allowed here" in SublimeLinter user setting. And it is not working. Other ignoring are working perfectly fine.

My friend, please try to understand that I don't have psychic powers. You refer to the SublimeLinter settings, but without seeing them it's very difficult for me to figure out what is happening.

My bad.

Here you have it.

{
    "user": {
        "debug": false,
        "delay": 0.25,
        "error_color": "D02000",
        "gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
        "gutter_theme_excludes": [],
        "lint_mode": "load/save",
        "linters": {
            "csslint": {
                "@disable": false,
                "args": [],
                "errors": "",
                "excludes": [],
                "ignore": "",
                "warnings": ""
            },
            "htmltidy": {
                "@disable": false,
                "args": [],
                "excludes": [],
                "ignore_match": [
                    "<meta> proprietary attribute",
                    "trimming empty",
                    "<input> proprietary attribute",
                    "not allowed here"
                ]
            },
            "jshint": {
                "@disable": false,
                "args": [],
                "excludes": []
            },
            "phplint": {
                "@disable": false,
                "args": [],
                "excludes": []
            }
        },
        "mark_style": "outline",
        "no_column_highlights_line": false,
        "paths": {
            "linux": [],
            "osx": [],
            "windows": []
        },
        "python_paths": {
            "linux": [],
            "osx": [],
            "windows": []
        },
        "rc_search_limit": 3,
        "shell_timeout": 10,
        "show_errors_on_save": false,
        "show_marks_in_minimap": true,
        "syntax_map": {
            "html (django)": "html",
            "html (rails)": "html",
            "html 5": "html",
            "php": "html",
            "python django": "python"
        },
        "warning_color": "DDB700",
        "wrap_find": true
    }
}

ignore_match is a regular expression that has to match the entire error message given by the linter binary. In this case the error message is '<' + '/' + letter not allowed here and you are trying to match that exactly with not allowed here, which of course won't work. A simple fix is to prefix the match with .*, which will match everything before not allowed here.

Thank you!

I just thought that it is possible to match part of the message. The problem is that if I place in ignore match the entire error message '<' + '/' + letter not allowed here it is still showing the error. But prepending a mask of .* is working ok.

Thanks a lot and sorry for ignorance :)