From d3269b6bc4f804a341b4fc4385f2ce7d9ab3eb70 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Wed, 7 May 2025 17:49:50 +0300 Subject: [PATCH] img and raw links --- zk | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/zk b/zk index 964eabc..4420ba9 100755 --- a/zk +++ b/zk @@ -63,6 +63,14 @@ navigate among existing notes. Ordinary C, C or similar tools can be used to search and quickly open results in the editor. +=item * + +C<[img|src|alt]> can be used to create link to images in HTML output. + +=item * + +C<[raw|url|text]> can be used to create arbitrary link in HTML output. + =back The only thing Vim lacks there is ability to tell who backlinks @@ -226,7 +234,14 @@ sub genHTML { $e =~ s/&/\&/g; $w = "$e"; } else { - if ($w =~ m/^\[.+\]$/) { + if ($w =~ /^\[img\|(.*)\|(.+)\]$/) { + $w = "\"$2\""; + } elsif ($w =~ /^\[raw\|(.*)\|(.+)\]$/) { + $w = "$2"; + } elsif ($w =~ /\[.+\]/) { + $w =~ s/&/\&/g; + $w =~ s//\>/g; while (my ($i, $l) = each @lnks) { $w =~ s/\[$l\]/[$l]<\/a>/g; } -- 2.48.1