Pārlūkot izejas kodu

Fixing over greedy footnote regex

main
Rocketsoup 1 gadu atpakaļ
vecāks
revīzija
45ec1a79ce
3 mainītis faili ar 5 papildinājumiem un 6 dzēšanām
  1. 2
    2
      js/markdown.js
  2. 1
    1
      js/markdown.min.js
  3. 2
    3
      markdownjs.html

+ 2
- 2
js/markdown.js Parādīt failu

@@ -2436,8 +2436,8 @@ class MDDefinitionListReader extends MDReader {
2436 2436
  * the document.
2437 2437
  */
2438 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 2443
 	 * @param {MDState} state

+ 1
- 1
js/markdown.min.js
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 2
- 3
markdownjs.html Parādīt failu

@@ -447,8 +447,7 @@ Click [here](#top) to return to the top. Referenced link to [Google][google].
447 447
 [testimage]: https://picsum.photos/102/75
448 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 451
 		</div>
453 452
 		<div class="previewhalf half">
454 453
 			<div id="preview">
@@ -456,4 +455,4 @@ Some verbatim &lt;span style="color:green;"&gt;HTML&lt;/span&gt;. A script tag w
456 455
 			</div>
457 456
 		</div>
458 457
 	</body>
459
-</html>
458
+</html>

Notiek ielāde…
Atcelt
Saglabāt