mirror of
				https://github.com/flynx/pWiki.git
				synced 2025-10-31 02:50:08 +00:00 
			
		
		
		
	bugfix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									d39568df77
								
							
						
					
					
						commit
						50c52ec88d
					
				| @ -1120,13 +1120,15 @@ var JSONOutline = { | |||||||
| 						attrs.splice(i, 1) | 						attrs.splice(i, 1) | ||||||
| 					: undefined } } | 					: undefined } } | ||||||
| 
 | 
 | ||||||
| 		var children = data.children | 		var children = (data.children ?? []) | ||||||
| 			.map(function(data){ | 			.map(function(data){ | ||||||
| 				return that.htmlBlock(data) }) | 				return that.htmlBlock(data) }) | ||||||
| 			.join('') | 			.join('') | ||||||
|  | 		// NOTE: the '\n' at the start of the textarea body below helps 
 | ||||||
|  | 		// 		preserve whitespace when parsing HTML...
 | ||||||
| 		return ( | 		return ( | ||||||
| `<div class="block ${ cls.join(' ') }" tabindex="0" ${ attrs.join(' ') }>\
 | `<div class="block ${ cls.join(' ') }" tabindex="0" ${ attrs.join(' ') }>\
 | ||||||
| <textarea class="code text" value="${ data.text }">${ data.text }</textarea>\ | <textarea class="code text" value="${ data.text }">\n${ data.text }</textarea>\ | ||||||
| <span class="view text">${ parsed.text }</span>\ | <span class="view text">${ parsed.text }</span>\ | ||||||
| <div class="children">${ children }</div>\ | <div class="children">${ children }</div>\ | ||||||
| </div>`) }, | </div>`) }, | ||||||
|  | |||||||
| @ -52,14 +52,25 @@ var setup = function(){ | |||||||
|     - blank line at end of block is initially not shown |     - blank line at end of block is initially not shown | ||||||
|       - this block contains two lines (empty below) |       - this block contains two lines (empty below) | ||||||
|          |          | ||||||
|  |         - `editor.Block(editor.data(editor.get())).querySelector('.view').innerHTML` -- '\n' present | ||||||
|  |         - _...is this a resize issue???_ | ||||||
|       -  |       -  | ||||||
|         this block also contains two lines (empty above) |         this block also contains two lines (empty above) | ||||||
|       -  |       -  | ||||||
|         this block contains three lines (empty above and below) |         this block contains three lines (empty above and below) | ||||||
|          |          | ||||||
|     - blank line at start of block is shown but removed on edit |     - DONE blank line at start of block is shown but removed on edit | ||||||
|  |       collapsed:: true | ||||||
|       -  |       -  | ||||||
|         this block also contains two lines (empty above) |         this block also contains two lines (empty above) | ||||||
|  |         - `editor.data(editor.get()).text` -- no `\n` at start... | ||||||
|  |         - `editor.get().querySelector('.code').value` -- no `\n` at start... | ||||||
|  |         - ``` | ||||||
|  |           d = document.createElement('div') | ||||||
|  |           d.innerHTML = editor.htmlBlock({text: '\nabc\n'}) // -> '\n' exists... | ||||||
|  |           d.querySelector('.code').value // -> no '\n' at start... | ||||||
|  |           ``` | ||||||
|  |           ...seems that the `\n` is lost on html parse... | ||||||
|       -  |       -  | ||||||
|         this block contains three lines (empty above and below) |         this block contains three lines (empty above and below) | ||||||
|          |          | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user