qgis2web icon indicating copy to clipboard operation
qgis2web copied to clipboard

add abstract - html text

Open jukos opened this issue 4 years ago • 9 comments

If I use html text there's a strange thing: After every link there are a break. If I use for example text with a link ("Text: Link") additional there are a break after the word "Text".

Export with leaflet

jukos avatar Apr 15 '20 15:04 jukos

@riccardoklinger?

tomchadwin avatar Apr 15 '20 15:04 tomchadwin

the abstract export is triggert using the same function which works on the title export. The relevant coding is here: titleSub += webmap_head.replace("'", "\\'").replace("\n", "<br />") Especially the replacement might destroy html hyperlinks. Can you provide your example abstract text from project settings with "anomyzed" urls @jukos?

riccardoklinger avatar Apr 15 '20 19:04 riccardoklinger

links are working correct, used abstract entry like this: this is a <a href="https://google.com">test</a> grafik But I can confirm the linebreak: grafik The generated HTML export looks exactly as desired: this._div.innerHTML = 'this is a <a href="https://google.com">test</a>';

riccardoklinger avatar Apr 15 '20 19:04 riccardoklinger

the abstract uses the leaflet-bar class like the zoom buttons and the geocoder plugin which are somehow supportive for mobile devices. I don't see a real value here and will remove them. was introduced here 438575f709b4ad15301dee6ec3bf55ff683692e7 10 month ago.

riccardoklinger avatar Apr 15 '20 20:04 riccardoklinger

by changing the max-width value of the abstractUncollapsed to 50% it workd for my small string. might be wrong solution for other strings. So waiting for your string as reference @jukos .

riccardoklinger avatar Apr 15 '20 20:04 riccardoklinger

changing this value will affect the size of the box if it is uncollapsed.

riccardoklinger avatar Apr 15 '20 20:04 riccardoklinger

fix is here in master: dcef3a064b3be86f29318f0c3a7f3999e14a6c07 please test @jukos

riccardoklinger avatar Apr 15 '20 20:04 riccardoklinger

No more problems with html text and links. Thank you.

But I have now not the same Design as for the search and -/+ icons. I can change the code after export, I tested this. But the best is: No changes after export.

Thank you and greetings

jukos avatar Apr 16 '20 07:04 jukos

Hi,

Testing this on qgis 3.10.4 and q2w 3.13 the linebreak even repeats when using multiple words as link, such as: This is a link to google please use this link. The abstract then contains three "sort of boxes" that contain the link, one for each word 'link', 'to' and 'google'. It puts these boxes beneath one another and they get mixed up with the rest of the text after a href code.

The fixed presented does remove this issue and for me it also improves the design of the abstract. It now has the same look and feel as Title. Personally I like that better than the abstract sharing the look and feel of the search and -/+ icons.

Jeroen-GroeneBij avatar Apr 20 '20 14:04 Jeroen-GroeneBij