Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug cannot import footnote from hash #2441

Merged
merged 23 commits into from
Mar 18, 2024
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 22 additions & 9 deletions packages/core/test/unit/html/includePanelProcessor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,28 @@ test('includeFile import footnote from hash', async () => {

const nodeProcessor = getNewDefaultNodeProcessor();
const result = await nodeProcessor.process(indexPath, index);
// to make lint happy; if write as array.join, some lines more than 100 characters;
const a = '<div>\n<p>text<trigger for="pop:footnotefn-1-1"><sup class="footnote-ref">';
const b = '<a aria-describedby="footnote-label" href="#fn-1-1">[1]</a></sup></trigger></p>';
const c = '</div><hr class="footnotes-sep">\n<section class="footnotes">\n';
const d = '<ol class="footnotes-list">\n<popover id="pop:footnotefn-1-1">\n';
const e = ' <template #content><div>\n <p>footnote</p>\n\n';
const f = ' </div></template>\n </popover>\n\n<li id="fn-1-1"';
const g = ' class="footnote-item"><p>footnote</p>\n</li>\n\n</ol>\n</section>\n';
const expected = a + b + c + d + e + f + g;
// to make lint happy
yiwen101 marked this conversation as resolved.
Show resolved Hide resolved
let longStr = '<p>text<trigger for="pop:footnotefn-1-1"><sup class="footnote-ref"><a aria-describedby="';
yiwen101 marked this conversation as resolved.
Show resolved Hide resolved
longStr += 'footnote-label" href="#fn-1-1">[1]</a></sup></trigger></p></div><hr class="footnotes-sep">';
const expected = [
'<div>',
longStr,
'<section class="footnotes">',
'<ol class="footnotes-list">',
'<popover id="pop:footnotefn-1-1">',
' <template #content><div>',
' <p>footnote</p>',
'',
' </div></template>',
' </popover>',
'',
'<li id="fn-1-1" class="footnote-item"><p>footnote</p>',
'</li>',
'',
'</ol>',
'</section>',
'',
].join('\n');

expect(result).toEqual(expected);
});
Expand Down
Loading