add support for links to other data pages
@@ -3,5 +3,5 @@
3
3
"name": "Manifest <Energy/Sensory effect>",
4
4
"rank": 1,
5
5
"types": "",
6
"description": "Manifest a magical effect. See the Material list to determine suitable effects."
6
"description": "Manifest a magical effect. See the [data:Material list:chapters/magicWords.json] to determine suitable effects."
7
7
}
@@ -3,5 +3,5 @@3
"name": "Manifest <Energy/Sensory effect>",3
"name": "Manifest <Energy/Sensory effect>",4
"rank": 1,4
"rank": 1,5
"types": "",5
"types": "",6
"description": "Manifest a magical effect. See the Material list to determine suitable effects."6
"description": "Manifest a magical effect. See the [data:Material list:chapters/magicWords.json] to determine suitable effects."7
}7
}@@ -175,13 +175,20 @@ final class TemplateRenderer
175
175
$template
176
176
);
177
177
178
// 5) Escaped images %%path%%
178
// 5) Escaped images [img:path]
179
179
$template = preg_replace_callback(
180
180
'/\[img:\s*([a-zA-Z0-9_\/.\-]+)\s*\]/',
181
181
fn($m) => '<div class="inlineImage"><img src="images/' . $m[1] . '"/></div>',
182
182
$template
183
183
);
184
184
185
// 6) Escaped data-links [data:text:path]
186
$template = preg_replace_callback(
187
'/\[data:\s*([a-zA-Z0-9_\/.\- ]+)\s*:\s*([a-zA-Z0-9_\/.\-]+)\s*\]/',
188
fn($m) => '<a href="?path=/data/' . $m[2] . '">' . $m[1] . '</a>',
189
$template
190
);
191
185
192
if (isset($data['wikiPath']))
186
193
$template = str_replace("<<url>>", "?path=" . $data['wikiPath'], $template);
187
194
@@ -175,13 +175,20 @@ final class TemplateRenderer175
$template175
$template176
);176
);177
177
178
// 5) Escaped images %%path%%178
// 5) Escaped images [img:path]179
$template = preg_replace_callback(179
$template = preg_replace_callback(180
'/\[img:\s*([a-zA-Z0-9_\/.\-]+)\s*\]/',180
'/\[img:\s*([a-zA-Z0-9_\/.\-]+)\s*\]/',181
fn($m) => '<div class="inlineImage"><img src="images/' . $m[1] . '"/></div>',181
fn($m) => '<div class="inlineImage"><img src="images/' . $m[1] . '"/></div>',182
$template182
$template183
);183
);184
184
185
// 6) Escaped data-links [data:text:path]186
$template = preg_replace_callback(187
'/\[data:\s*([a-zA-Z0-9_\/.\- ]+)\s*:\s*([a-zA-Z0-9_\/.\-]+)\s*\]/',188
fn($m) => '<a href="?path=/data/' . $m[2] . '">' . $m[1] . '</a>',189
$template190
);191
185
if (isset($data['wikiPath']))192
if (isset($data['wikiPath']))186
$template = str_replace("<<url>>", "?path=" . $data['wikiPath'], $template);193
$template = str_replace("<<url>>", "?path=" . $data['wikiPath'], $template);187
194