mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 07:34:42 -04:00
Add support of embed pdf
This commit is contained in:
parent
558304ff62
commit
3424cdd771
6 changed files with 52 additions and 16 deletions
|
@ -152,6 +152,10 @@ var supportExternals = [
|
|||
{
|
||||
text: '{%speakerdeck speakerdeckid %}',
|
||||
search: 'speakerdeck'
|
||||
},
|
||||
{
|
||||
text: '{%pdf pdfurl %}',
|
||||
search: 'pdf'
|
||||
}
|
||||
];
|
||||
var supportExtraTags = [
|
||||
|
@ -1836,20 +1840,6 @@ function importFromUrl(url) {
|
|||
});
|
||||
}
|
||||
|
||||
function isValidURL(str) {
|
||||
var pattern = new RegExp('^(https?:\\/\\/)?' + // protocol
|
||||
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
|
||||
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
|
||||
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
|
||||
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
|
||||
'(\\#[-a-z\\d_]*)?$', 'i'); // fragment locator
|
||||
if (!pattern.test(str)) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//mode
|
||||
ui.toolbar.mode.click(function () {
|
||||
toggleMode();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue