Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow tilde to be used to suppress any wikitext rule #188

Open
Jermolene opened this issue Oct 29, 2013 · 12 comments
Open

Allow tilde to be used to suppress any wikitext rule #188

Jermolene opened this issue Oct 29, 2013 · 12 comments

Comments

@Jermolene
Copy link
Member

No description provided.

@Spangenhelm
Copy link
Contributor

Question:

i have a password in my tiddly wiki that contains a ` so it transforms the following text in "code" and i cannot find a way to prevent this even with a tilde ~

capture du 2014-11-02 12 16 50

I know i can "escape it" with double or triple ` but i just want to prevent it instead of escaping it.
Any help ?

@pmario
Copy link
Member

pmario commented Nov 2, 2014

You can start your tiddler with:

\rules except codeinline

PW: 112345`asdf

The except rule will avoid rendering the backtick. To display code you'll need to use

```
```

instead

@Jermolene
Copy link
Member Author

Hi @Spangenhelm there are a couple of techniques you can use:

  • Disable the codeinline parser rule, as @pmario shows above
  • You can use ` which will display as a backtick without triggering any of the backtick syntax rules
  • You can use double backticks for inline code that itself contains backticks:
Password: ``112345`asdf``

@Spangenhelm
Copy link
Contributor

Thanks gentlemens

Disable the codeinline parser rule, as @pmario shows above

I'll note that for later use but i thought about something more "localised" like a escape character for a single line (/ or ~ before the ` for example, exactly as the title say), not for the whole tiddler. (btw this trick/tip do not appear in standard help in tw ?)

You can use ` which will display as a backtick without triggering any of the backtick syntax rules

I guess it would be a good solution in my case, while i wait for this to be fixed.

You can use double backticks for inline code that itself contains backticks:

I know but it "transforms" the text and it is not what i want in my situation.

Thanks for your time and your help, greatly appreciated!
Hope this issue will be solved quickly as it would be really useful for everybody.

@tobibeer
Copy link
Contributor

Disable the codeinline parser rule
\rules except codeinline  

Is there a reference somewhere of all core parser rules, i.e. names + decription?

@Spangenhelm
Copy link
Contributor

@tobibeer
Not sure but i think these are all shadow tiddlers, and each tiddler equals a rule.
You can do an advanced search with $:/core/modules/parsers/wikiparser/rules/ to find them but i have no idea if there is any reference other than that.

Also (might be useful):
"WikiText can include blocks of text that are rendered with an explicit ContentType"
http://tiddlywiki.com/#Typed%20Blocks%20in%20WikiText

@Jermolene
Copy link
Member Author

Hi @tobibeer

Is there a reference somewhere of all core parser rules, i.e. names + decription?

The parse rule names aren't exposed at the moment. You can see them by typing the following in your browser JavaScript console:

Object.keys($tw.Wiki.parsers["text/vnd.tiddlywiki"].prototype.pragmaRuleClasses);
Object.keys($tw.Wiki.parsers["text/vnd.tiddlywiki"].prototype.blockRuleClasses);
Object.keys($tw.Wiki.parsers["text/vnd.tiddlywiki"].prototype.inlineRuleClasses);

@pmario
Copy link
Member

pmario commented Nov 15, 2014

@tobibeer
see: https://github.com/Jermolene/TiddlyWiki5/tree/master/core/modules/parsers/wikiparser/rules

I did add a little bit more docs to the "emphasis" rules, as I did split it up into several rules, to increase flexibility.

see:
https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/parsers/wikiparser/rules/emphasis/bold.js

The module header info isn't exposed to users at the moment.

@tobibeer
Copy link
Contributor

Thanks @Spangenhelm , @Jermolene, @pmario for the references!

Perhaps a good idea to have a parserrules field on tiddlywiki.com for each WikiText tiddler listing the corresponding parser rules and then aggregating that somwhere in a Parser Rules tiddler that also lists and explains the available switches.

\rules except bold
\rules only bold

By the way, is this: \keyword option param a general construct or something only relating to parser rules? ...and how do you call that: "switches"?

The module header info isn't exposed to users at the moment.

Not sure if and how that can be even done but it would probably improve the documentation workflow.

@Jermolene
Copy link
Member Author

By the way, is this: \keyword option param a general construct or something only relating to parser rules? ...and how do you call that: "switches"?

They are called pragmas. They go at the start of a tiddler and apply to the entire rest of the body. Currently there's just \rules and \define.

@BurningTreeC
Copy link
Contributor

Hi, this one can be closed I think

\rules only <-- note, without more declarations ... no parser-rules

as of 5.1.18 , ~ aka "Tilde" is used for if-else logic within filters

@Jermolene
Copy link
Member Author

Jermolene commented Dec 7, 2018

Hi @BurningTreeC I think generalising the anti-wikifying function of "˜" isn't affected by the new filter operator "˜". The original motivation of this PR was to be able to turn of CamelCase linking without causing existing references to "˜HelloThere" to break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants