From 462926e6fa3e7a2983a7eb170873fb4444029564 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sun, 14 Feb 2021 22:04:39 +0000 Subject: Still more borked links --- pelican/content/Dashboard.md | 2 +- pelican/content/GettingStartedNovena.md | 2 +- pelican/content/StateOfPlay.md | 2 +- pelican/content/UsingSTLink.md | 2 +- pelican/content/WhoWeAre.md | 2 +- trac2md.py | 38 +++++++++++++++------------------ 6 files changed, 22 insertions(+), 26 deletions(-) diff --git a/pelican/content/Dashboard.md b/pelican/content/Dashboard.md index dfc6a1b..d8a8884 100644 --- a/pelican/content/Dashboard.md +++ b/pelican/content/Dashboard.md @@ -64,7 +64,7 @@ Date: 2016-12-15 22:44 | Curve25519 | Started | | | | Ed25519 | Not started | | | | P-256, P-384 ECDSA | Started | | | -| GOST R 34.10-2001 | Started | [[https://trac.cryptech.is/browser/user/shatov/gost/streebog]]([https://trac.cryptech.is/browser/user/shatov/gost/streebog]) | Core in provisional repo. Will be moved to the the hash core section.| +| GOST R 34.10-2001 | Started | [https://trac.cryptech.is/browser/user/shatov/gost/streebog](https://trac.cryptech.is/browser/user/shatov/gost/streebog) | Core in provisional repo. Will be moved to the the hash core section.| diff --git a/pelican/content/GettingStartedNovena.md b/pelican/content/GettingStartedNovena.md index 1777d7f..72fead7 100644 --- a/pelican/content/GettingStartedNovena.md +++ b/pelican/content/GettingStartedNovena.md @@ -147,4 +147,4 @@ It is strongly suggested to change the so pin and pin (in that order above) to s The lab DNSSEC signer MUST, at this point, be running on a 32-bit system in order to work with the 32-bit Novena. -[[https://www.dropbox.com/s/f8b4s9vic7hsqyb/cryptech-proxy-lab-20150718r2.pdf]]([https://www.dropbox.com/s/f8b4s9vic7hsqyb/cryptech-proxy-lab-20150718r2.pdf]) +[https://www.dropbox.com/s/f8b4s9vic7hsqyb/cryptech-proxy-lab-20150718r2.pdf](https://www.dropbox.com/s/f8b4s9vic7hsqyb/cryptech-proxy-lab-20150718r2.pdf) diff --git a/pelican/content/StateOfPlay.md b/pelican/content/StateOfPlay.md index 446a2bd..e5dae85 100644 --- a/pelican/content/StateOfPlay.md +++ b/pelican/content/StateOfPlay.md @@ -79,7 +79,7 @@ what's happening here. At least some of the modules that `verilator` complains about not being able to find appear to come from XiLinx libraries that `verilator` doesn't know about. -See [Libraries Guide for HDL Designs]]([http://www.xilinx.com/support/documentation/sw_manuals/xilinx12_1/spartan6_hdl.pdf|Spartan-6) for details. +See [Spartan-6 Libraries Guide for HDL Designs](http://www.xilinx.com/support/documentation/sw_manuals/xilinx12_1/spartan6_hdl.pdf) for details. ### Module relationships in core/novena build diff --git a/pelican/content/UsingSTLink.md b/pelican/content/UsingSTLink.md index a44eb53..93a420b 100644 --- a/pelican/content/UsingSTLink.md +++ b/pelican/content/UsingSTLink.md @@ -4,7 +4,7 @@ Modified: 2019-01-24 14:37 # Using ST-LINK -ST-LINK is STM's implementation of the [| Serial Wire Debug (SWD)](https://developer.arm.com/products/architecture/cpu-architecture/debug-visibility-and-trace/coresight-architecture/serial-wire-debug) protocol. +ST-LINK is STM's implementation of the [ Serial Wire Debug (SWD)](https://developer.arm.com/products/architecture/cpu-architecture/debug-visibility-and-trace/coresight-architecture/serial-wire-debug ) protocol. Think of it as JTAG if you're more comfortable with that. ## Getting an ST-LINK programmer diff --git a/pelican/content/WhoWeAre.md b/pelican/content/WhoWeAre.md index 0475b61..274a917 100644 --- a/pelican/content/WhoWeAre.md +++ b/pelican/content/WhoWeAre.md @@ -29,7 +29,7 @@ Peter Stuge [Randy Bush](https://psg.com/~randy) -[Austein]]([https://www.hactrn.net/sra/|Rob) +[Rob Austein](https://www.hactrn.net/sra/) Steven Bellovin diff --git a/trac2md.py b/trac2md.py index f7816ce..9a41d1c 100755 --- a/trac2md.py +++ b/trac2md.py @@ -14,10 +14,9 @@ from base64 import b64decode from datetime import datetime from urllib.parse import quote -wikilink_1_pattern = re.compile('\[http(.*)\]') -wikilink_1_extract = re.compile('\[(.*)\]') -wikilink_2_pattern = re.compile('\[\[([a-zA-Z0-9_]+)\]\]') -strikethrough_pattern = re.compile('~~(.*)~~') +wikilink_1_pattern = re.compile("\[\[(http.*)\]\]|\[(http.*)\]") +wikilink_2_pattern = re.compile("\[\[([a-zA-Z0-9_]+)\]\]") +strikethrough_pattern = re.compile("~~(.*)~~") camelcase_pattern = re.compile("!(\w+)") image_pattern = re.compile("\[\[Image\((.*)\)\]\]") @@ -74,20 +73,17 @@ def convert_headers(line): def convert_wikilinks_1(line): ''' Convert wikiformat links ''' - if wikilink_1_pattern.search(line): - try: - result = wikilink_1_extract.search(line).group(1) - if result: - parts = result.split(' ', 1) - if len(parts) == 1: - mdlink = '[%s](%s)' % (parts[0], parts[0]) - elif len(parts) == 2: - mdlink = '[%s](%s)' % (parts[1], parts[0]) - line = line.replace('[' + result + ']', mdlink) - except: - # Not a link, not a problem - pass - + m = wikilink_1_pattern.search(line) + if m: + text = m.group(1) or m.group(2) + for sep in "| ": + if sep in text: + parts = text.split(sep, 1) + break + else: + parts = [text] + mdlink = "[{}]({})".format(parts[-1], parts[0]) + line = line.replace(m.group(0), mdlink) return line @@ -97,10 +93,10 @@ def convert_wikilinks_2(line): if m: text = m.group(1) if text.lower() == "pageoutline": - link = "" + mdlink = "" else: - link = "[{0}]({0})".format(text) - line = line.replace(m.group(0), link) + mdlink = "[{0}]({0})".format(text) + line = line.replace(m.group(0), mdlink) return line -- cgit v1.2.3