You've already forked joplin
							
							
				mirror of
				https://github.com/laurent22/joplin.git
				synced 2025-10-31 00:07:48 +02:00 
			
		
		
		
	This commit is contained in:
		
							
								
								
									
										43
									
								
								.yarn/patches/markdown-it-multimd-table-npm-4.1.1-47e334d4bd
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								.yarn/patches/markdown-it-multimd-table-npm-4.1.1-47e334d4bd
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,43 @@ | ||||
| diff --git a/index.js b/index.js | ||||
| index 85d89900d5fe575dd0c19430209fb1703b03554e..5fa68cc9a4bd2b21a7188bd263262fd9b1604ac6 100644 | ||||
| --- a/index.js | ||||
| +++ b/index.js | ||||
| @@ -145,7 +145,8 @@ module.exports = function multimd_table_plugin(md, options) { | ||||
|          colspan, leftToken, | ||||
|          rowspan, upTokens = [], | ||||
|          tableLines, tgroupLines, | ||||
| -        tag, text, range, r, c, b; | ||||
| +        tag, text, range, r, c, b, t, | ||||
| +        blockState; | ||||
|   | ||||
|      if (startLine + 2 > endLine) { return false; } | ||||
|   | ||||
| @@ -315,18 +316,26 @@ module.exports = function multimd_table_plugin(md, options) { | ||||
|   | ||||
|          /* Multiline. Join the text and feed into markdown-it blockParser. */ | ||||
|          if (options.multiline && trToken.meta.multiline && trToken.meta.mbounds) { | ||||
| -          text = [ text.trimRight() ]; | ||||
| +          // Pad the text with empty lines to ensure the line number mapping is correct | ||||
| +          text = new Array(trToken.map[0]).fill('').concat([ text.trimRight() ]); | ||||
|            for (b = 1; b < trToken.meta.mbounds.length; b++) { | ||||
|              /* Line with N bounds has cells indexed from 0 to N-2 */ | ||||
|              if (c > trToken.meta.mbounds[b].length - 2) { continue; } | ||||
|              range = [ trToken.meta.mbounds[b][c] + 1, trToken.meta.mbounds[b][c + 1] ]; | ||||
|              text.push(state.src.slice.apply(state.src, range).trimRight()); | ||||
|            } | ||||
| -          state.md.block.parse(text.join('\n'), state.md, state.env, state.tokens); | ||||
| +          blockState = new state.md.block.State(text.join('\n'), state.md, state.env, []); | ||||
| +          blockState.level = trToken.level + 1; | ||||
| +          // Start tokenizing from the actual content (trToken.map[0]) | ||||
| +          state.md.block.tokenize(blockState, trToken.map[0], blockState.lineMax); | ||||
| +          for (t = 0; t < blockState.tokens.length; t++) { | ||||
| +            state.tokens.push(blockState.tokens[t]); | ||||
| +          } | ||||
|          } else { | ||||
|            token          = state.push('inline', '', 0); | ||||
|            token.content  = text.trim(); | ||||
|            token.map      = trToken.map; | ||||
| +          token.level    = trToken.level + 1; | ||||
|            token.children = []; | ||||
|          } | ||||
|   | ||||
| @@ -78,5 +78,8 @@ | ||||
|     "node-gyp": "^8.4.1", | ||||
|     "nodemon": "^2.0.9" | ||||
|   }, | ||||
|   "packageManager": "yarn@3.1.1" | ||||
|   "packageManager": "yarn@3.1.1", | ||||
|   "resolutions": { | ||||
|     "markdown-it-multimd-table@4.1.1": "patch:markdown-it-multimd-table@npm:4.1.1#.yarn/patches/markdown-it-multimd-table-npm-4.1.1-47e334d4bd" | ||||
|   } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user