Selaa lähdekoodia

Enable auto-linking in Markdown

This get's feature-completition to plain-text auto-linking.
Fixes https://github.com/PrivateBin/PrivateBin/issues/336
rugk 8 vuotta sitten
vanhempi
sitoutus
c1ab1dd8c5
3 muutettua tiedostoa jossa 5 lisäystä ja 3 poistoa
  1. 3 1
      js/privatebin.js
  2. 1 1
      tpl/bootstrap.php
  3. 1 1
      tpl/page.php

+ 3 - 1
js/privatebin.js

@@ -1773,7 +1773,9 @@ jQuery.PrivateBin = (function($, sjcl, Base64, RawDeflate) {
                     var converter = new showdown.Converter({
                         strikethrough: true,
                         tables: true,
-                        tablesHeaderId: true
+                        tablesHeaderId: true,
+                        simplifiedAutoLink: true,
+                        excludeTrailingPunctuationFromURLs: true
                     });
                     // let showdown convert the HTML and sanitize HTML *afterwards*!
                     $plainText.html(

+ 1 - 1
tpl/bootstrap.php

@@ -75,7 +75,7 @@ if ($MARKDOWN):
 <?php
 endif;
 ?>
-		<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-w/zjLcgT4cJcMplN6yncy2EDu3+hxuto0Flxwa4ShhK2ceO/JRQJglZXB1lD9TLTf9EnwsHnaqh4dt7dGxiMxA==" crossorigin="anonymous"></script>
+		<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-0G0kfqJ9im61vY7wBS3UlCjwLvQw8EeNppPy/SWDIuX+2iS6hgM4KbvgTQ6nJwDZPwbsT3R2bPanQKBWKTXcqA==" crossorigin="anonymous"></script>
 		<!--[if lt IE 10]>
 		<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
 		<![endif]-->

+ 1 - 1
tpl/page.php

@@ -54,7 +54,7 @@ if ($QRCODE):
 <?php
 endif;
 ?>
-		<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-w/zjLcgT4cJcMplN6yncy2EDu3+hxuto0Flxwa4ShhK2ceO/JRQJglZXB1lD9TLTf9EnwsHnaqh4dt7dGxiMxA==" crossorigin="anonymous"></script>
+		<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-0G0kfqJ9im61vY7wBS3UlCjwLvQw8EeNppPy/SWDIuX+2iS6hgM4KbvgTQ6nJwDZPwbsT3R2bPanQKBWKTXcqA==" crossorigin="anonymous"></script>
 		<!--[if lt IE 10]>
 		<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
 		<![endif]-->