Skip to content
GitLab
Explore
Sign in
This is an archived project. Repository and other project resources are read-only.
Legacy
Trac
Wiki
Torweeklynews
Linkify
Linkify
· Changes
Page history
Raw import from Trac using Trac markup language.
authored
Jun 15, 2020
by
Alexander Færøy
Hide whitespace changes
Inline
Side-by-side
TorWeeklyNews/Linkify.md
0 → 100644
View page @
53a16e3a
{{{
#!/usr/bin/ruby
# -*- coding: utf-8 -*-
lines = $stdin.readlines
refs = {}
lines.each do |line|
next unless line =~ /^
*
\[
(
\d
+)
\]
:
[
](
http.+
)
$/
refs[$1] = $2.strip
end
lines.each do |line|
next if line =~ /^
*
\[
(
\d
+)
\]
:
[
](
http.+
)
$/
line.gsub!(/
\[
(
\d
+)
\]
/) do
"
<a
href=
\"#{refs[$1]}\"
></a>
"
end
$stdout.write line
end
}}}
\ No newline at end of file