Skip to content

Commit fa197d4

Browse files
save file
1 parent 1456fb9 commit fa197d4

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

utils/editors/markdown-editor/html/output-md/v2.0/output-md-v2.0.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,25 @@
283283
npm_readme = $(shadow,'#readme');
284284

285285

286+
287+
288+
shadow.addEventListener('click',e=>{
289+
290+
var link = e.target.closest('a[href^="#"]');
291+
if(!link)return;
292+
console.log('link',link);
293+
var id = link.getAttribute('href');
294+
id = id.slice(1);
295+
var target = shadow.getElementById(id);
296+
if(!target)return;
297+
console.log('target',target);
298+
e.preventDefault();
299+
target.scrollIntoView({behavior:'smooth'});
300+
301+
});
302+
303+
304+
286305
}//initdom
287306

288307

@@ -411,9 +430,13 @@
411430

412431
show('npm');
413432

433+
434+
414435
}//npm
415436

416437

438+
439+
417440
async function github_markdown(txt){
418441

419442
var body = txt;

0 commit comments

Comments
 (0)