Added support for address element

pull/213/head
M66B 1 year ago
parent 8e6fcc8742
commit 3ff861edeb

@ -6,6 +6,10 @@ For support you can use [the contact form](https://contact.faircode.eu/?product=
### [Ubirajara](https://en.wikipedia.org/wiki/Ubirajara_jubatus)
### Next version
* Replace [address element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/address) by [geo](https://en.wikipedia.org/wiki/Geo_URI_scheme) link
### 1.2091 - 2023-08-05
* Fixed crash

@ -6,6 +6,10 @@ For support you can use [the contact form](https://contact.faircode.eu/?product=
### [Ubirajara](https://en.wikipedia.org/wiki/Ubirajara_jubatus)
### Next version
* Replace [address element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/address) by [geo](https://en.wikipedia.org/wiki/Geo_URI_scheme) link
### 1.2091 - 2023-08-05
* Fixed crash

@ -539,7 +539,7 @@ public class HtmlHelper {
sheets = parseStyles(parsed.head().select("style"));
Safelist safelist = Safelist.relaxed()
.addTags("hr", "abbr", "big", "font", "dfn", "del", "s", "tt", "mark")
.addTags("hr", "abbr", "big", "font", "dfn", "del", "s", "tt", "mark", "address")
.addAttributes(":all", "class")
.addAttributes(":all", "style")
.addAttributes("span", "dir")
@ -1100,6 +1100,12 @@ public class HtmlHelper {
hs.attr("x-line-after", "true");
}
// Replace addresses by link
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/address
for (Element address : document.select("address"))
address.tagName("a")
.attr("href", "geo:0,0?q=" + Uri.encode(address.text()));
// Paragraphs
for (Element p : document.select("p")) {
p.tagName("div");

@ -6,6 +6,10 @@ For support you can use the contact form.
Ubirajara
Next version
* Replace address element link
1.2091 - 2023-08-05
* Fixed crash

Loading…
Cancel
Save