mirror of
https://github.com/tcsenpai/obsidiangarden_netlify.git
synced 2025-06-05 12:25:20 +00:00
Add support for slashes in tags
This commit is contained in:
parent
3176a78c03
commit
255e1d531d
@ -8,6 +8,8 @@ const { parse } = require("node-html-parser");
|
||||
|
||||
const { headerToId, namedHeadingsFilter } = require("./src/helpers/utils");
|
||||
|
||||
const tagRegex = /(^|\s|\>)(#[^\s!@#$%^&*()=+\.,\[{\]};:'"?><]+)(?!([^<]*>))/g;
|
||||
|
||||
module.exports = function (eleventyConfig) {
|
||||
let markdownLib = markdownIt({
|
||||
breaks: true,
|
||||
@ -194,7 +196,7 @@ module.exports = function (eleventyConfig) {
|
||||
return (
|
||||
str &&
|
||||
str.replace(
|
||||
/(^|\s|\>)(#[^\s!@#$%^&*()=+\.\/,\[{\]};:'"?><]+)(?!([^<]*>))/g,
|
||||
tagRegex,
|
||||
function (match, precede, tag) {
|
||||
return `${precede}<a class="tag" onclick="toggleTagSearch(this)">${tag}</a>`;
|
||||
}
|
||||
@ -207,7 +209,7 @@ module.exports = function (eleventyConfig) {
|
||||
let match =
|
||||
str &&
|
||||
str.match(
|
||||
/(^|\s|\>)(#[^\s!@#$%^&*()=+\.\/,\[{\]};:'"?><]+)(?!([^<]*>))/g
|
||||
tagRegex,
|
||||
);
|
||||
if (match) {
|
||||
tags = match
|
||||
|
Loading…
x
Reference in New Issue
Block a user