From e29afaae3314c4e7bf5e90a5690aaed1936d2dad Mon Sep 17 00:00:00 2001 From: mDuo13 Date: Wed, 16 Dec 2020 16:55:36 -0800 Subject: [PATCH] Support HTML in hover_anchors --- dactyl-config.yml | 2 +- tool/filter_unicode_header_ids.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dactyl-config.yml b/dactyl-config.yml index 7d365455f1..f1b784debd 100644 --- a/dactyl-config.yml +++ b/dactyl-config.yml @@ -77,7 +77,7 @@ targets: display_name: XRPL.org <<: *defaults prefix: "" - hover_anchors: "ΒΆ" + hover_anchors: link_subs: "./src/api-v3/paths/preparations/payments.ts": "https://github.com/xpring-eng/xrp-api/blob/master/src/api-v3/paths/preparations/payments.ts" readability_goals: diff --git a/tool/filter_unicode_header_ids.py b/tool/filter_unicode_header_ids.py index 91d784a15f..c76c5f1f0f 100644 --- a/tool/filter_unicode_header_ids.py +++ b/tool/filter_unicode_header_ids.py @@ -10,6 +10,8 @@ ################################################################################ import re +from bs4 import BeautifulSoup + ## HTML5's 'id' attribute requirements are: ## - Must be at least one character in length. ## - Must not contain ASCII whitespace. @@ -69,5 +71,5 @@ def filter_soup(soup, currentpage={}, **kwargs): "href": "#"+new_id, "class": "hover_anchor", "aria-hidden": "true"}) - hoverlink.append(hoveranchor_contents) + hoverlink.append(BeautifulSoup(hoveranchor_contents, "html.parser")) h.append(hoverlink)