tweecode / twine

UI for creating hypertext stories
http://twinery.org
657 stars 97 forks source link

Potential inconsistency between Wiki links with no alt text and ones with #98

Closed greyelf closed 10 years ago

greyelf commented 10 years ago

I'm not sure if this is a bug or as designed in Sugarcane header.

When you create a wiki link with alternative text and the passage referenced does not exist then it assumes that the reference is actually a external link and is styled as if the link is valid.

If you click this link the browser with show a 'File Not Found' error (or words to that effect depending on browser) instead of the standard "Error: this passage does not exist" message.

eg.

[[Missing Passage]]  --> Shows in red and displays a "Error: this passage does not exist" message if clicked.
[[Alt Text|Missing Passage]] --> Shows as an external link and results in a 'File Not Found' error if clicked
webbedspace commented 10 years ago

This has always been the case since Twine's inception. But, it's a little annoying. If you can think of a way for the engine to unambiguously distinguish between someone linking to the HTML resource "thing" and the non-existent passage "thing", do tell.

greyelf commented 10 years ago

You may want to contact the guy that maintains the SugarCube header about this issue. I reported the same issue about his header and he has created a possible solution in his development version.

webbedspace commented 10 years ago

I had a look... it seems that SugarCube simply decides it's an external URI only if it contains a dot, hash or either slash. Which... is about the same kind of naive solution I would've gone with, so I'll go with it.