Escaped characters resolving web path within code tag

(Euan Hawthorne) #1

I want to display a code example of how our editors should be adding a class and link to their images.
I have this:

Which will display in the wysiwyg editor like this:

<a href="./?a=256113"><img src="./?a=256113" alt=“Bleaching of the rock at Moonlight Falls (2013)” class=“imagethird” /></a>

But when the page is previewed the web paths resolve and we see this:

Which is not very helpfull for our editors.
Has anyone found a way around this without having to use images?

(John gill) #2

You could use non-existant asset ids, or use a fixed-width-non-joiner character.

&lt;a href="./?a=&zwnj;361"&gt;asdkljaslkdj&lt;/a&gt;

The &zwnj; will prevent the URL from being converted, but has no effect on the page rendering.

(Serge) #3

Yeah matrix parsing engine – through PHP – likely uses a regex that matches ./?a=[0-9], so as JohnGill mentioned, using an id that does not exists or something like ./?a=asset_id_of_image will ensure that the parser won’t match the string and replace it, that should keep it intact for editors to read.

Or provide them with a screenshot :wink:

(Euan Hawthorne) #4

Thanks for your replies. I got around it by replacing the asset id with nnnnn. But now I think about it this may even confuse our editors, I will replace with 9876543 or something. Thank you.

(Bart Banda) #5

You could also do something like: