Intra-post permalink

Is there any way to have an intra-post permalink with only a URL hash?

In other words, if I want to link to reply #3, can I do that? The regular permalink is a full URL, and if I add that, then it requires a page reload. Since it’s the same page, is there any way to link to a reply with only a URL hash?


test: [quote=“elijah, post:4, topic:56880”]well the [quote] syntax works, but it creates an inline quote, I just want a link.[/quote]

test reply 1…

test reply 2…

Are you asking for something like the link you get with

[quote="USER, post:N, topic:M, full:true"]

?

You could possibly add just stub quotes.

[quote=“elijah, post:4, topic:56880”]

Sort of, but I just want to make it into a link that ends up as a URL fragment (intra-page link). See my “example of full URL link” in the original post.

Off-hand I don’t think that is doable, but it makes it clear what you want.

Incorrect, it only requires a page reload if the target post is not currently loaded. @eviltrout can confirm.

4 إعجابات

odd, we have a Discourse server at our company and if I use full URL links, it does cause a page reload. If a page with URL A links to a page with URL B, how can it avoid a page reload? It seems to work correctly on this page (I still don’t understand how), but maybe that’s just a really fast operation that appears seamless to me.

The JavaScript doing that magic :slight_smile:

It may behaved like that because of some other reason. Can you please try again?

إعجاب واحد (1)

Please no citations of “magic”; if you know how it works, please let me know. I’m inspecting the link and I see no onclick handler, if something is going on, it is very subtle and I don’t understand.

I guess it must be some evil Ember magic Preventing and Retrying Transitions - Routing - Ember Guides

إعجاب واحد (1)

I did try again, it is still doing a page reload, which again, is the behavior I would expect. Both our company’s Discourse instance and this Discourse instance appear to be using 1.8.0.beta4, although different git hashes:

this page: <meta name="generator" content="Discourse 1.8.0.beta4 - https://github.com/discourse/discourse version ba115480ba782587f07cb9d08ac7a77927910a71">

our server: <meta name="generator" content="Discourse 1.8.0.beta4 - https://github.com/discourse/discourse version c36dda70aeb6e97efaf7ad0cb932df18f0281722">

Have you tried adding a space before the link?

Intra-post permalink

Adding a space where?

When it’s on it’s own line, adding a space before the link will prevent it from being oneboxed.


https://meta.discourse.org/t/intra-post-permalink/56880/3

renders as

whereas

 https://meta.discourse.org/t/intra-post-permalink/56880/3

renders as

Intra-post permalink - #3 by jmsachs

oh, I see, that explains what “oneboxed” means and why it occurs. Yes, if I put a link all by itself it does that, but if I do something like

[link](http://myserver/t/test-test-test-test-is-a-test-test-argh/343/3)

then it displays properly, but the “magic” page reload interception logic doesn’t work, I get a normal page reload to the URL http://myserver/t/test-test-test-test-is-a-test-test-argh/343/3

The only difference I can see is that our server is http:// (inside company firewall + noncritical server, so it’s much less of a concern) rather than https:// – could this be the difference?

yes, switching between http and https could be causing the page reloads.

إعجاب واحد (1)

The scheme should have no impact unless you have your instance misconfigured (ie. have it think it should use https but there still are links using http).

إعجاب واحد (1)

no, I’m not switching between http:// and https:// – our server is http:// and the links are http://

Is there a way I can troubleshoot this? I have admin privileges, I just have no clue what to look for.

I can’t understand why it is happening like that. Can you please share a screencast? You may hide your sensitive details.