fitnesse icon indicating copy to clipboard operation
fitnesse copied to clipboard

Disable automatic link generation from WikiWords

Open fhoeben opened this issue 4 years ago • 4 comments

I often get frustrated in (Slim scripts/scenarios) tests where I need to enter a text that matches the definition of a FitNesse Wiki-word (e.g. SomeUser). I always have to remember to escape such texts (e.g. !-SomeUser-!), to prevent FitNesse from making it a link to a non existing page.

For me the ability to create links using WikiWords (instead of having to make an explicit link) is far less useful than just being able to use such texts without additional escaping in a script table.

I would like the ability to turn off WikiWords links for the entire wiki, or maybe on a suite hierarchy level.

I understand this might be different for other users, and can be a backwards compatibility issue, but it would make my life easier. So the change should be configurable.

I believe I'm not alone in not (always) wanting WikiWords to be turned into link, see also https://github.com/unclebob/fitnesse/pull/1307#issuecomment-727958651

fhoeben avatar Nov 16 '20 13:11 fhoeben

Some thoughts about this:

Adding a table prefix like in my example in the referenced PR to the parser's table class is pretty simple. However, because any symbolTypes defined in plugins are -by default- only registered to the wikiParsingProvider, these would have to be explicitly registered to a new 'no links' Provider as well, or we'd have to let the ContextConfigurator explicitly call loadSymbolTypes for both providers.

What would be the preferred approach? Or is there another option I've overlooked?

I've made a working implementation in #1310 so we can test if that works. To be clear, that PR is an extended version of #1307. Where 1307 only allows extension from plugins, 1310 implements the extension in the Table itself (whilst still leaving it extensible)

tcnh avatar Nov 20 '20 14:11 tcnh

Some initial thoughts: In many cases, the automatic generation of links from wikiwords is not useful. It might be helpful to be able to turn this off and use some kind of simple markup to generate links only when wanted, e.g. This is NotAlink but this @IsAlink. Should this be configurable for the entire wiki or by individual pages? The NoLink table allows very fine control, i.e., at the table level, but only applies to one type of markup.

jediwhale avatar Nov 20 '20 23:11 jediwhale

The alias widget already provides a way to specify a link: [[description][link]]. We could make the description part optional so you could specify a link as [[link]] if auto-linking was turned off. There could be a command line argument to turn auto linking off: something like: -parser noautolink. (This could also be used to enable other parsers, if I ever finish one :). ) This would let you turn off auto-linking for your entire wiki and specify links where you needed them. If you wanted auto-links on some pages, you could leave auto-linking on and use the no-link table and literals to turn them off where required.

jediwhale avatar Nov 23 '20 01:11 jediwhale

What is the problem you're trying to fix here? I haven't noticed any situation where there's a problem aside from within tables for testdata or input.

E-mail, hyperlinks and WiKiWords in tables are a problem when there's a lot of those things in a (script/scenario) table and using a literal table breaks other functionality (like !today). But aside from tables, is there really a need to disable autolinking anywhere else? Are there really any situations where WiKiWord linking is a problem outside of a table?

lennyg1 avatar Nov 24 '20 09:11 lennyg1