qgis2web
qgis2web copied to clipboard
add abstract - html text
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
@riccardoklinger?
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?
links are working correct, used abstract entry like this:
this is a <a href="https://google.com">test</a>
But I can confirm the linebreak:
The generated HTML export looks exactly as desired:
this._div.innerHTML = 'this is a <a href="https://google.com">test</a>';
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.
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 .
changing this value will affect the size of the box if it is uncollapsed.
fix is here in master: dcef3a064b3be86f29318f0c3a7f3999e14a6c07 please test @jukos
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
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.