浏览代码

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

Hakim El Hattab 1 年之前
父节点
当前提交
db2523db27
共有 3 个文件被更改,包括 5 次插入1 次删除
  1. 0 0
      plugin/notes/notes.esm.js
  2. 0 0
      plugin/notes/notes.js
  3. 5 1
      plugin/notes/plugin.js

文件差异内容过多而无法显示
+ 0 - 0
plugin/notes/notes.esm.js


文件差异内容过多而无法显示
+ 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
 		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';
 		}
 

部分文件因为文件数量过多而无法显示