Browse Source

add support for aside element notes inside of fragments (fixes #3478)

Hakim El Hattab 1 năm trước cách đây
mục cha
commit
db2523db27

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
plugin/notes/notes.esm.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
plugin/notes/notes.js


+ 5 - 1
plugin/notes/plugin.js

@@ -147,7 +147,11 @@ const Plugin = () => {
 
 
 		// Look for notes defined in an aside element
 		// Look for notes defined in an aside element
 		if( notesElements && notesElements.length ) {
 		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';
 			messageData.markdown = notesElements[0] && typeof notesElements[0].getAttribute( 'data-markdown' ) === 'string';
 		}
 		}
 
 

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác