Skip to content
This repository was archived by the owner on Feb 16, 2024. It is now read-only.

Commit 76e2528

Browse files
committed
fix: module/flag ref links
1 parent 7c8536a commit 76e2528

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

assets/javascripts/lib/discourse-markdown/custom-bbcodes.js.es6

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ export function setup(helper) {
5252
url: m => `https://docs.doomemacs.org/-/package/#/${m[1]}`,
5353
text: m => m[1]
5454
},
55-
'^(?::([\w-]+)(?: ([\w-]+))(?: \+([\w-]+))?|\+([\w-]+))$': {
55+
'^(?:(:[\\w-]+)(?: ([\\w-]+))(?: \\+([\\w-]+))?|\\+([\\w-]+))$': {
5656
class: 'ref-module',
5757
url: m => {
58-
const [_, category, module, flag] = m;
59-
if (category[0] !== ":") {
60-
flag = category;
58+
let [_, category, module, flag, loneflag] = m;
59+
if (loneflag) {
60+
flag = loneflag;
6161
[_, category, module] = window.location.pathname.match(/\/modules\/([^\/]+)\/([^\/]+)\//);
6262
if (!(category && module)) {
6363
console.err(`Couldn't resolve current module for [[${flag}]] link`);

0 commit comments

Comments
 (0)