T
T
toha_man2020-04-07 03:35:41
Pug
toha_man, 2020-04-07 03:35:41

Pug Interpolation inside attributes?

I've been digging around and haven't been able to figure out how to do it right. Since I love pug, but I have to write and php code I chose so far the simplest solution (instead of phug, which is supposedly a complete solution for pug + php) - just insert php code through |

But it is not possible to insert into attributes - they are always escaped < >

The inter-t should be like this:
p some text #{variable}
p some text !{variable} - for unescaped output

Into strings like this:
- var str = "some text ${variable }" and like #{variable} is also possible
But how to display unescaped for a string is a mystery.

The task itself is typical for php , substitute the address of the image
img.imgClassname(src=" <?php echo server_img_uri()?>") - but the characters < > are rendered through &
As soon as I didn’t pervert, it didn’t work out, I temporarily decided by inserting the html code into pug, but this is not convenient ((

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question