Skip to content

Commit

Permalink
Merge pull request #124 from tomabrafix/fix-broken-export-link
Browse files Browse the repository at this point in the history
Fix broken export link if URL does not contain /p/
  • Loading branch information
SamTV12345 authored Oct 17, 2023
2 parents 7d164cb + 78cb07e commit e32063b
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 13 deletions.
1 change: 0 additions & 1 deletion ep.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"hooks":{
"expressCreateServer": "ep_markdown/express",
"eejsBlock_exportColumn": "ep_markdown/index",
"eejsBlock_scripts": "ep_markdown/index",
"eejsBlock_mySettings": "ep_markdown/index",
"import": "ep_markdown/index"
},
Expand Down
4 changes: 0 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ exports.eejsBlock_exportColumn = (hookName, context) => {
context.content += eejs.require('./templates/exportcolumn.html', {}, module);
};

exports.eejsBlock_scripts = (hookName, context) => {
context.content += eejs.require('./templates/scripts.html', {}, module);
};

exports.eejsBlock_styles = (hookName, context) => {
context.content += eejs.require('./templates/styles.html', {}, module);
};
Expand Down
7 changes: 0 additions & 7 deletions static/js/main.js

This file was deleted.

4 changes: 4 additions & 0 deletions static/js/markdown.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
'use strict';

exports.postAceInit = (hookName, context) => {
const padRootPath = new RegExp(/.*\/p\/[^/]+/)
.exec(document.location.pathname) || clientVars.padId;
$('#exportmarkdowna').attr('href', `${padRootPath}/export/markdown`);

const enable = () => {
// add css class markdown
$('iframe[name="ace_outer"]').contents().find('iframe')
Expand Down
1 change: 0 additions & 1 deletion templates/scripts.html

This file was deleted.

0 comments on commit e32063b

Please sign in to comment.