Trial implementing pretty links via a macro

An experiment for #3883
This commit is contained in:
Jermolene 2019-03-29 22:04:13 +00:00
parent 1c436cbbf3
commit b799d924f0
2 changed files with 19 additions and 7 deletions

View File

@ -0,0 +1,13 @@
title: $:/core/macros/shortcuts/prettylink
tags: $:/tags/Macro
\define x-tm-prettylink-internal(to,text)
<$link to=<<__to__>>><$text text=<<__text__>>/></$link>
\end
\define tm-prettylink-internal(to,text)
<$button>
<$action-navigate $to=<<__to__>>/>
<$text text=<<__text__>>/>
</$button>
\end

View File

@ -49,13 +49,12 @@ exports.parse = function() {
}]; }];
} else { } else {
return [{ return [{
type: "link", type: "macrocall",
attributes: { name: "tm-prettylink-internal",
to: {type: "string", value: link} params: [
}, {name: "to", value: link},
children: [{ {name: "text", value: text}
type: "text", text: text ]
}]
}]; }];
} }
}; };