Skip to content

Commit

Permalink
Fix regex used to extract relative links in docs (#2161)
Browse files Browse the repository at this point in the history
Signed-off-by: Cintia Sanchez Garcia <[email protected]>
  • Loading branch information
cynthia-sg authored Jul 26, 2022
1 parent 4e98d39 commit fbc7258
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/www/themes/hugo-geekdoc/layouts/partials/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
{{ $.Scratch.Set "content" ($.Scratch.Get "content" | replaceRE "(<h[2-9] id=\"([^\"]+)\"[^>]*>)(.*?)(</h[2-9]+>)" (printf `<div class="gdoc-page__anchorwrap">%s%s<a data-clipboard-text="%s" class="gdoc-page__anchor gdoc-page__anchor--right clip" aria-label="Anchor %s" href="#%s"><svg class="icon link"><use xlink:href="#link"></use></svg></a>%s</div>` `${1}` `${3}` (absURL (printf "%s#%s" .Permalink `${2}`)) `${3}` `${2}` `${4}`) | safeHTML) }}
{{ end }}

{{ $.Scratch.Set "content" ($.Scratch.Get "content" | replaceRE "<a href=\"https://github.com/artifacthub/hub/blob/master/docs/(.*?).md\">(.*?)</a>" (printf `<a href="/docs/%s">%s</a>` `${1}` `${2}`) | safeHTML) }}
{{ $.Scratch.Set "content" ($.Scratch.Get "content" | replaceRE "<a href=\"https://github.com/artifacthub/hub/blob/master/docs/([^<]*?).md\">(.*?)</a>" (printf `<a href="/docs/%s">%s</a>` `${1}` `${2}`) | safeHTML) }}

{{ $.Scratch.Get "content" }}

0 comments on commit fbc7258

Please sign in to comment.