Skip to content

Commit

Permalink
add support for aside element notes inside of fragments (fixes hakime…
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel committed Sep 19, 2023
1 parent eb01f8f commit db2523d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugin/notes/notes.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugin/notes/notes.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion plugin/notes/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ const Plugin = () => {

// Look for notes defined in an aside element
if( notesElements && notesElements.length ) {
messageData.notes = Array.from(notesElements).map( notesElement => notesElement.innerHTML ).join( '\n' );
// Ignore notes inside of fragments since those are shown
// individually when stepping through fragments
notesElements = Array.from( notesElements ).filter( notesElement => notesElement.closest( '.fragment' ) === null );

messageData.notes = notesElements.map( notesElement => notesElement.innerHTML ).join( '\n' );
messageData.markdown = notesElements[0] && typeof notesElements[0].getAttribute( 'data-markdown' ) === 'string';
}

Expand Down

0 comments on commit db2523d

Please sign in to comment.