Open modal for internal links (WIP)
This commit is contained in:
@@ -151,12 +151,13 @@ Utils.buildBibliography = async function(recordUri, recordId) {
|
||||
* to Stimulus links
|
||||
*/
|
||||
Utils.parseMarkers = function(text) {
|
||||
const regex = /(?<marker>\[marker coords=\"(?<coords>[\d\s\.]+)\"\](?<content>[\w\s\.;:\-]+)\[\/marker\])/mig;
|
||||
const regex = /(?<marker>\[marker coords=\"(?<coords>[\d\s\.]+)\"\ ?(group=\"(?<group>\w+)\")?](?<content>[\w\s\.;:\-]+)\[\/marker\])/mig;
|
||||
let matches = [...text.matchAll(regex)];
|
||||
|
||||
if (matches.length) {
|
||||
matches.forEach(match => {
|
||||
const replacement = `<a data-action="marker#go modal#close" data-controller="marker" data-marker-coords-value="${match.groups.coords}">
|
||||
const replacement = `<a data-action="marker#go modal#close tabs#reset marker#goAndOpen" data-controller="marker"
|
||||
data-marker-coords-value="${match.groups.coords}" data-marker-group-value="${match.groups.group}">
|
||||
${match.groups.content}</a>`;
|
||||
text = text.replace(match.groups.marker, replacement.trim());
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user