[Lua widgets] Generated hashtags links do not open `tag:` virtual pages properly

Try this please:

```space-lua
widgets = widgets or {}

function widgets.testHashtagLink(hashtag)
  local hashtag = hashtag or 'meta'
  return widget.new {
    markdown = '[[tag:' .. hashtag .. '|' .. hashtag .. ']] #' .. hashtag .. '\n',
    display  = 'block'
  }
end
```
${widgets.testHashtagLink('existing/name')}

Now try to click to the [[]] link and it will correctly display the tag:hashtag virtual page. Then try to click the #hashtag link and it will only open url:hashtag which, indeed, does not exist so browser just show blank dark page (in case of my Firefox). Styling with CSS works on the #hastag links which is exactly why I would like to see this to work again to have styled hashtag listings back (it used to work for me in v1).

I tried your example. However, I get a different behaviour:

The first link just shows as a normal link and opens the tag:existing/name page, just like expected.
The second is displayed just like a tag (OK so far), but if I click on it, NOTHING happens.

However, if I create the tag manually, clicking on it opens the page as expected.

I’m currently running SilverBullet 2.0.0-0d886c884feed1e6550bfec459940524ace52a50 on windows as well as SilverBullet 2.0.0-42-gf991b3d2 on linux/docker.
Both behave similar.

The different behaviour may be because it opens new tab. If I write hashtag manually, it also works for me. It does not work if it was generated in the page. It should work the same as normal written hashtag… :frowning:

I am running on main edge.

Good 'ol detecting it as a protocol. There probably should be an encodeURIComponent there

@MrMugame OK, should I create GH issue for it now?

1 Like

Moving this to GH issue.

1 Like

I’m having the same issue with tags when I extract all the tags from all the pages on my index page using a query:

${table.concat(query[[from index.tag "tag" where not name:startsWith("meta") order by name select  "#" .. _.name]]," ")}

they show up fine:

but if i try opening them (clicking them) they open as

tag:test

instead of the expected:

http://localhost:3001/tag%3Atest

I’ve seen the bug report on github, but I wanted to ask if there is a temporary fix to this or any forecast when this can be resolved? Thanks in advance :folded_hands:

This PR should fix it.

1 Like