Jump to content

Markup Regions with HTML Comments

Recommended Posts

Is there any way of keeping HTML comments in content rendered via Markup Regions? Per default all comments seem to get filtered out (Why this?). There is a forum thread touching this topic but it doesn't answer how to get the comments back.  I found in 'wire/core/WireMarkupRegions.php' there seems to be an option "exact" with is explained as:


exact (bool): Return region markup exactly as-is? (default=false). Specify true when using return values for replacement.

but I'm not sure if that's what I need. At least changing the default value in wire, doesn't seem to make any difference. I also found that comments starting with a hash symbol will be kept intact, like

<!--#Test -->

but those are actually intended as Markup Region Hints so it might affect performance to use them as regular comments!?

  • Like 1

Share this post

Link to post
Share on other sites

It doesn't look like there is a way to keep HTML comments intact when using the core Markup Regions feature. Even if there was a way to set the "exact" option you mentioned (which there isn't currently because the Markup Regions methods aren't hookable), comments are also removed here.

You could make a feature request at GitHub for an option to keep HTML comments.

  • Like 2
  • Thanks 1

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...