2

I am using bun (and a library called bun-plugin-html) to inject css and javascript and build a source html file to a target file.

The html is actually a Tumblr template so it uses handlebars/moustache-like syntax for variables.

Currently bun is clever enough that it complains about the markup not being valid.

It does seem to work and parse the file, but I would like to suppress these warnings in the console. I am assuming this is possible.

Although the file uses curly braces style syntax, it is not the same as an .hbs file (that seems to use the rewriter in a different way). Any pointers? Can't seem to find much information online about this, but maybe it's not a bun issue (hence the jsdom tag).

Here is an example

   <li class="post photo">
      {LinkOpenTag}
         <img src="{PhotoURL-500}" {block:HighRes}style="display:none"{/block:HighRes} />
             {block:HighRes}
                           ^
HTMLParseError: Specified <img> src '{PhotoURL-500}' does not exist! 
   at ./src/index-tmp.html:332:55
      <img src="{PhotoURL-500}" {block:HighRes}style="display:none". 
      {/block:HighRes} />
   {block:HighRes}
      <img src="{PhotoURL-HighRes}" class="highres">
   {/block:HighRes}
                  ^
HTMLParseError: Specified <img> src '{PhotoURL-HighRes}' does not exist!
0

1 Answer 1

1

I'm the author of bun-plugin-html, and these errors are actually generated by bun-plugin-html, to let the user know if there has been issues with linking things! I'll make a release to add an option to suppress these errors. You can view the issue I've made for tracking this here.

Thank you for using bun-plugin-html!

Edit: v2.2.8 has been published, it adds the new option suppressErrors to bun-plugin-html.

Sign up to request clarification or add additional context in comments.

1 Comment

DUDE! You have outdone yourself thanks so much. I was sure this was a bun issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.