diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2024-10-18 13:12:13 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2024-10-18 13:12:13 +0800 |
commit | dbe6179d42a50899bf97585b0c8437129dd408f4 (patch) | |
tree | 60d4eabbdc1b228865f2fc0e7fa17f1f7178143e /src/dumbymap.mjs | |
parent | 684203b326392688821d514f69f8d6b954a58b1b (diff) | |
parent | f76555b48a3f6c1956c933e9421cf4aba704fb21 (diff) |
Merge branch addon
Diffstat (limited to 'src/dumbymap.mjs')
-rw-r--r-- | src/dumbymap.mjs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dumbymap.mjs b/src/dumbymap.mjs index 2879319..1b7c685 100644 --- a/src/dumbymap.mjs +++ b/src/dumbymap.mjs | |||
@@ -171,8 +171,8 @@ export const generateMaps = (container, { | |||
171 | delete container.dataset.layout | 171 | delete container.dataset.layout |
172 | 172 | ||
173 | /** Prepare Semantic HTML part and blocks of contents inside */ | 173 | /** Prepare Semantic HTML part and blocks of contents inside */ |
174 | const htmlHolder = container.querySelector('.SemanticHtml') ?? | 174 | const htmlHolder = container.querySelector('.SemanticHtml, main, :scope > article') ?? |
175 | Array.from(container.children).find(e => e.id?.includes('main') || e.className.includes('main')) ?? | 175 | Array.from(container.children).find(e => e.id?.includes('main') || e.className?.includes?.('main')) ?? |
176 | Array.from(container.children).sort((a, b) => a.textContent.length < b.textContent.length).at(0) | 176 | Array.from(container.children).sort((a, b) => a.textContent.length < b.textContent.length).at(0) |
177 | htmlHolder.classList.add('SemanticHtml') | 177 | htmlHolder.classList.add('SemanticHtml') |
178 | 178 | ||