find_brack = v.find(']]')
if find_brack == -1:
return
+ hashtag = ""
link = v[2:find_brack]
+ rest = link.split("#") # can be joined up again with '#'.join(rest)
+ link = rest[0]
out.write(" link %s\n" % link)
lookups = {'sv': 'Scalable Vectors for Power ISA',
'SV|sv': 'Scalable Vectors for Power ISA',
out.write(" found RFC %s\n" % link)
return [Link(['', [], []],
[Str("{RFC "+link+"}")],
- ['#%s' % link, '']), Str(v[find_brack+2:])]
+ ['#%s' % link, '']),
+ Str(v[find_brack+2:])]
if link in lookups:
out.write(" found %s\n" % lookups[link])
return [Link(['', [], []],
[Str("{"+lookups[link]+"}")],
- ['#%s' % link, '']), Str(v[find_brack+2:])]
+ ['#%s' % linklookups(rest), '']),
+ Str(v[find_brack+2:])]
if '|' in link:
link, ref = link.split("|")
return [Link(['', [], []],
[Str(link)],
- [ref, '']), Str(v[find_brack+2:])]
+ [ref, '']),
+ Str(v[find_brack+2:])]
if k == 'Link':
out.write(" link type %s\n" %
(type(v[1][0])))
if re.fullmatch(r"< */ *small *>", v[1]):
return [RawInline('latex', '}')]
+def linklookups(rest):
+ res = '#'.join(rest)
+ if len(rest[0]) == 0:
+ res = '_'.join(rest[1:])
+ return res
if __name__ == "__main__":
toJSONFilter(inlinenotes)