Project

General

Profile

Apparently incoherent RefEncoder behaviour

Added by Stefan Hainzl almost 3 years ago

Hello everyone,

I suppose I am getting something confused, so here it comes:
I have a WText with setInternalPathEncoding(true), 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:

  1. Remove the img tag
  2. Set a breakpoint (also without removing the img tag)

I hope you could give me a hint. Thank you!

Best regards,
Stefan


Replies (4)

RE: Apparently incoherent RefEncoder behaviour - Added by Stefan Hainzl almost 3 years ago

... 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.

Thank you!
Stefan

RE: Apparently incoherent RefEncoder behaviour - Added by Bruce Toll almost 3 years ago

I believe that you need to place quotes around attribute values in XHTML, e.g. width="40".

RE: Apparently incoherent RefEncoder behaviour - Added by Stefan Hainzl almost 3 years ago

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!
Stefan

RE: Apparently incoherent RefEncoder behaviour - Added by Stefan Hainzl almost 3 years ago

Hello again,

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

Best regards,
Stefan

    (1-4/4)