Apparently incoherent RefEncoder behaviour
I suppose I am getting something confused, so here it comes:
I have a WText with
setTextFormat(Wt::TextFormat::UnsafeXHTML) and then the following text set:
This is where a general introduction of the part family will be provided.<br/> <a href="#/engineering/bom">go to BOM</a><br/> Images can also be added: <br/> <img width=40; src='/resources/dLS_Logo.png'></img>
The logo is showing fine, but the link is not working. There are however two ways to make it work:
- Remove the
- Set a breakpoint (also without removing the
I hope you could give me a hint. Thank you!
... sorry, I forgot to add: wt-log.log gives me a hint:
[error] "RefEncoder: Error reading XHTML string: expected ' or """
... but as said, I must be missing the obvious, because the quotes are there.
RE: Apparently incoherent RefEncoder behaviour - Added by Bruce Toll over 1 year ago
I believe that you need to place quotes around attribute values in XHTML, e.g. width="40".
Thanks a lot Bruce!
It is true, I tried that already. Trying it again just now, it still gives me the same result, i.e. error message plus non-working link.
In the meantime I have left the text (or rather XHTML) the same and every once in a while, when having compiled for another reason, tried it again. --> sometimes it works, most times not.
Thank you everyone in advance!
Now I know what you tried to tell me Bruce, sorry. I have clearly outed myself as a bloody XHTML rookie ...
Apart from the missing quotes around the value, there were some more mistakes. It is hence actually surprising that it did work sometimes.
Everyone else coming to this thread, I recommend pasting and checking their XHTML code there: https://validator.w3.org/nu/#textarea