question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prevent special symbols to be turned into html entities inside @{{ }}

See original GitHub issue

With this answer, I was able to generate Laravel compatible PHP template https://github.com/maizzle/framework/issues/293#issuecomment-774433678

But seems like it works only for root-level variables, I cannot use structure access as an array or object.

I have only one problem - special symbols.

  "website_url": "@{{ $page->website_url }}",

turns into

<a href="{{ $page-&gt;website_url }}"

and

  "website_url": "@{{ $page['website_url'] }}",

turns into

<a href="{{ $page[&#039;website_url&#039;] }}"

How can I prevent it?

_Originally posted by @seyfer in https://github.com/maizzle/framework/issues/293#issuecomment-834483051_

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
seyfercommented, May 10, 2021

@cossssmin seems like I was very tired on Friday 😄 yeah sure it works!

0reactions
seyfercommented, May 10, 2021

@cossssmin unfortunately, the page level variables are always staying escaped. I will create a new issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to prevent special HTML characters being interpreted into ...
The HTML entity for the special character & is & . ... You can use strreplace and then replace it with image,html symbols...
Read more >
How do you prevent HTML special character coding from ...
Other special characters always can be escaped with entities, but only need to be if you are using a character set that doesn't...
Read more >
HTML entities in links are converted to symbols even if they do ...
It looks like this happens with any string of characters that would be an HTML entity if you added a semicolon. (Not just...
Read more >
htmlspecialchars - Manual - PHP
Certain characters have special significance in HTML, and should be represented by HTML entities if they are to preserve their meanings.
Read more >
CSS Entities - W3Schools
Complete CSS Entity Reference. If you use CSS to display any of these characters in HTML, you can use the CSS entity found...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found