docute icon indicating copy to clipboard operation
docute copied to clipboard

Anchor tags don't work

Open niftylettuce opened this issue 8 years ago • 3 comments

e.g. Go to https://lassjs.github.io/lass/#/ and click on "contributors" link which should jump you down the page to the Contributors section, but instead takes you to 404. I think we should rewrite logic to autojump #foo for ?id=foo support?

niftylettuce avatar Sep 03 '17 19:09 niftylettuce

hmm, it works fine for me...

egoist avatar Sep 04 '17 01:09 egoist

I mean the link "contributors" in this screenshot @egoist:

screen shot 2017-09-03 at 9 59 09 pm

niftylettuce avatar Sep 04 '17 01:09 niftylettuce

oh, docute only transforms #id to ?id=id when it's written in markdown 😅 you can add a plugin to work around this:

docute.init({
  plugins: [
    replaceHref
  ]
})

function replaceHref(ctx) {
  ctx.on('content:updated', vm => {
    vm.$el.querySelector('a[href="#contributors"]').setAttribute('href', '...')
  })
}

egoist avatar Sep 04 '17 02:09 egoist