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

Notes plugin: notes from data-notes attribute were not shown #3477

Merged
Merged
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion plugin/notes/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const Plugin = () => {
}

// Look for notes defined in an aside element
if( notesElements ) {
if( notesElements && notesElements.length ) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

notesElements is either null(if there is .current-fragment) or a list of elements(result of slideElement.querySelectorAll( 'aside.notes' )).

So if we have a slide:

  1. without fragments at all(so no .current-fragment)
  2. with notes specified through data-notes

We did never see the notes because condition if( notesElements ) was always true even though list was empty

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