Jump to content

Markup spec/BNF/Magic links: Difference between revisions

From mediawiki.org
Content deleted Content added
m Reverted edits by 90.196.109.232 (talk) to last version by Dexbot
Tag: Rollback
Gymate (talk | contribs)
Added RFC link examples; removed unnecessary space
Line 24: Line 24:


Counter-examples:
Counter-examples:
* ISBN 12345678901 (not followed by non-word character )
* ISBN 12345678901 (not followed by non-word character)
* ISBN 123456789 (too short)
* ISBN 123456789 (too short)
* ISBN 97-81234567890 (dashes not allowed in prefix)
* ISBN 97-81234567890 (dashes not allowed in prefix)
Line 34: Line 34:
<syntaxhighlight lang="bnf">
<syntaxhighlight lang="bnf">
<rfc-number> ::= "RFC" <spaces> <digits>
<rfc-number> ::= "RFC" <spaces> <digits>
</syntaxhighlight>
</syntaxhighlight>Examples:

* RFC 0001
* RFC 3986


== PubMed IDs ==
== PubMed IDs ==

Revision as of 14:05, 21 June 2024

Magic links are words that may appear within <wiki-text> that are automatically converted to external links without any special markup being required by the person writing the page.

<magic-link>	::= <isbn> | <rfc-number> | <pmid-number>

Note that all character-literals on this page are case sensitive (i.e. upper-case characters in the definitions on this page MUST be written in upper case in the markup).

ISBN numbers

See Manual:ISBN

<isbn>		::= "ISBN" (" "+) <isbn-number> ?(non-word-character /\b/)
<isbn-number>	::= ("97" ("8" | "9") (" " | "-")?) (DIGIT (" " | "-")?) {9} (DIGIT | "X" | "x")

Examples:

Counter-examples:

  • ISBN 12345678901 (not followed by non-word character)
  • ISBN 123456789 (too short)
  • ISBN 97-81234567890 (dashes not allowed in prefix)
  • ISBN1234567890 (no spaces)

RFCs

See Manual:RFC

<rfc-number>	::= "RFC" <spaces> <digits>

Examples:

PubMed IDs

<pmid-number>	::= "PMID" <spaces> <digits>