[0.1.3] more formatting fixes

aeiou
This commit is contained in:
yellows111 2024-10-11 17:56:31 +01:00
parent 4e65d573b2
commit 8736d49e52
Signed by: yellows111
SSH Key Fingerprint: SHA256:ynw5IJBU1pb7fZfHgLihKu9gHHA8FVpixZbB6IEB3r8
3 changed files with 9 additions and 5 deletions

View File

@ -63,11 +63,11 @@ function format(data, name) {
"$1$2$3$4" "$1$2$3$4"
) )
.replace( /* multitag prefix fix for ( and [ */ .replace( /* multitag prefix fix for ( and [ */
/([(\[])\n\t*(<(?:code|a href=".*")>.*<\/(?:code|a)>)/g, /([(\[])\n\t*(<(?:code|a href=".+?")>.*<\/(?:code|a)>)/g,
"$1$2" "$1$2"
) )
.replace( /* multitag suffix fix for special characters. */ .replace( /* multitag suffix fix for special characters. */
/(<\/(?:a|code)>)\n\t*([.)\];:,])/g, /(<\/(?:a|code)>)\n\t*([.)\];:,?!+-])/g,
"$1$2" "$1$2"
) )
.replace( /* fix tag attached to word and not whitespace */ .replace( /* fix tag attached to word and not whitespace */
@ -83,6 +83,10 @@ function format(data, name) {
function(match, inline) { function(match, inline) {
return "<pre><code>" + inline.replace(/\t/g, "") + "</code></pre>"; return "<pre><code>" + inline.replace(/\t/g, "") + "</code></pre>";
} }
)
.replace( /* fix monospace'd links */
/<a href="(.+?)">\n\t+<code>(.*?)<\/code>\n\t+<\/a>/g,
"<a href=\"$1\"><code>$2</code></a>"
); );
} }
// probably should bring in a better templating engine but whatever // probably should bring in a better templating engine but whatever

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "yiki", "name": "yiki",
"version": "0.1.2", "version": "0.1.3",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "yiki", "name": "yiki",
"version": "0.1.2", "version": "0.1.3",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@liquify/prettify": "^0.5.5-beta.1", "@liquify/prettify": "^0.5.5-beta.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "yiki", "name": "yiki",
"version": "0.1.2", "version": "0.1.3",
"description": "The yellows111 wiki system", "description": "The yellows111 wiki system",
"main": "compile.js", "main": "compile.js",
"scripts": { "scripts": {