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

Ignore script templates #233

Closed
akshayrawat opened this issue Jul 31, 2015 · 5 comments
Closed

Ignore script templates #233

akshayrawat opened this issue Jul 31, 2015 · 5 comments
Assignees

Comments

@akshayrawat
Copy link

@akshayrawat akshayrawat commented Jul 31, 2015

Is it possible to ignore script templates just like HTML5 tags which aren't supported by Nokogiri/libxml2? Or is there another workaround to ignore errors on these snippets?

<script type="text/html">
   <li></li>
</script>

<script type="text/x-handlebars-template">
   <li></li>
</script>

Error:

  • Element script embeds close tag

Its very common for frameworks (Ember, Knockout etc.) to have html fragments as script text templates.

@gjtorikian
Copy link
Owner

@gjtorikian gjtorikian commented Jul 31, 2015

You can add the data-proofer-ignore attribute to any tag to ignore it: https://github.com/gjtorikian/html-proofer/blob/master/README.md#ignoring-content

Would that work?

@akshayrawat
Copy link
Author

@akshayrawat akshayrawat commented Aug 3, 2015

I tried a few things, and it doesn't work

<script type="text/html" id="navbar-logged-in" data-proofer-ignore>
    <li><a href="https://www.clerky.com/features">Home</a></li>
</script>

and

<script type="text/html" id="navbar-logged-in" data-proofer-ignore>
    <li><a href="https://www.clerky.com/features" data-proofer-ignore>Home</a></li>
</script>
@doktorbro
Copy link

@doktorbro doktorbro commented Aug 3, 2015

@akshayrawat What are the options you pass to Proofer?

@akshayrawat
Copy link
Author

@akshayrawat akshayrawat commented Aug 3, 2015

task :html_proofer do
  HTML::Proofer.new(
    "./build",
    {
      check_favicon: true,
      check_html: true #Yep

      parallel: {
        in_processes: 3
      }
    }
  ).run
end
@gjtorikian
Copy link
Owner

@gjtorikian gjtorikian commented Aug 5, 2015

Well hot diggity. I can reproduce this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants