Просмотр исходного кода

Fixing over greedy footnote regex

main
Rocketsoup 1 год назад
Родитель
Сommit
45ec1a79ce
3 измененных файлов: 5 добавлений и 6 удалений
  1. 2
    2
      js/markdown.js
  2. 1
    1
      js/markdown.min.js
  3. 2
    3
      markdownjs.html

+ 2
- 2
js/markdown.js Просмотреть файл

2436
  * the document.
2436
  * the document.
2437
  */
2437
  */
2438
 class MDFootnoteReader extends MDReader {
2438
 class MDFootnoteReader extends MDReader {
2439
-	static #footnoteWithTitleRegex = /^\[\^([^\]]+?)\s+"(.*?)"\]/;  // 1=symbol, 2=title
2440
-	static #footnoteRegex = /^\[\^([^\]]+?)\]/;  // 1=symbol
2439
+	static #footnoteWithTitleRegex = /^\[\^([^\s\[\]]+?)\s+"(.*?)"\]/;  // 1=symbol, 2=title
2440
+	static #footnoteRegex = /^\[\^([^\s\[\]]+?)\]/;  // 1=symbol
2441
 
2441
 
2442
 	/**
2442
 	/**
2443
 	 * @param {MDState} state
2443
 	 * @param {MDState} state

+ 1
- 1
js/markdown.min.js
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 2
- 3
markdownjs.html Просмотреть файл

447
 [testimage]: https://picsum.photos/102/75
447
 [testimage]: https://picsum.photos/102/75
448
 [google]: https://google.com  "I prefer Duck Duck Go"
448
 [google]: https://google.com  "I prefer Duck Duck Go"
449
 
449
 
450
-Some verbatim <span style="color:green;">HTML</span>. A script tag will be ignored. <script></script>
451
-			</textarea>
450
+Some verbatim &lt;span style="color:green;"&gt;HTML&lt;/span&gt;. A script tag will be ignored. &lt;script&gt;&lt;/script&gt;</textarea>
452
 		</div>
451
 		</div>
453
 		<div class="previewhalf half">
452
 		<div class="previewhalf half">
454
 			<div id="preview">
453
 			<div id="preview">
456
 			</div>
455
 			</div>
457
 		</div>
456
 		</div>
458
 	</body>
457
 	</body>
459
-</html>
458
+</html>

Загрузка…
Отмена
Сохранить