# The parsoid-compatible option below is only relevant when we are running # parser tests in integrated mode with Parsoid. This option is ignored # when this test file is run with Parsoid in standalone mode. !! options parsoid-compatible=wt2html,wt2wt version=2 !! end !! test Magic links: internal link to RFC (T2479) !! wikitext [[RFC 123]] !! html/php
!! html/parsoid !! end !! test Magic links: RFC (T2479) !! options cat !! wikitext RFC 822 !! metadata cat=Pages_using_RFC_magic_links sort= !! html/php !! html/parsoid !! end !! test Magic links: RFC (T67278) !! wikitext This is RFC 822 but thisRFC 822 is not RFC 822linked. !! html/phpThis is RFC 822 but thisRFC 822 is not RFC 822linked.
!! html/parsoidThis is RFC 822 but thisRFC 822 is not RFC 822linked.
!! end !! test Magic links: RFC (w/ non-newline whitespace, T30950/T31025) !! wikitext RFC 822 RFC 822 !! html/phpRFC 822 RFC 822
!! html/parsoidRFC 822 RFC 822
!! end !! test Magic links: ISBN (T3937) !! options cat !! wikitext ISBN 0-306-40615-2 !! metadata cat=Pages_using_ISBN_magic_links sort= !! html/php !! html/parsoid !! end !! test Magic links: ISBN (T67278) !! wikitext This is ISBN 978-0-316-09811-3 but thisISBN 978-0-316-09811-3 is not ISBN 978-0-316-09811-3linked. !! html/phpThis is ISBN 978-0-316-09811-3 but thisISBN 978-0-316-09811-3 is not ISBN 978-0-316-09811-3linked.
!! html/parsoidThis is ISBN 978-0-316-09811-3 but thisISBN 978-0-316-09811-3 is not ISBN 978-0-316-09811-3linked.
!! end !! test Magic links: ISBN (w/ non-newline whitespace, T30950/T31025) !! wikitext ISBN 978 0 316 09811 3 ISBN 9780316098113 ISBN 978 0316098113 !! html/phpISBN 978 0 316 09811 3 ISBN 9780316098113 ISBN 978 0316098113
!! html/parsoidISBN 978 0 316 09811 3 ISBN 9780316098113 ISBN 978 0316098113
!! end !! test Magic links: PMID incorrectly converts space to underscore !! wikitext PMID 1234 !! html/php !! html/parsoid !! end !! test Magic links: PMID (T67278) !! options cat !! wikitext This is PMID 1234 but thisPMID 1234 is not PMID 1234linked. !! metadata cat=Pages_using_PMID_magic_links sort= !! html/phpThis is PMID 1234 but thisPMID 1234 is not PMID 1234linked.
!! html/parsoidThis is PMID 1234 but thisPMID 1234 is not PMID 1234linked.
!! end !! test Magic links: PMID (w/ non-newline whitespace, T30950/T31025) !! wikitext PMID 1234 PMID 1234 !! html/phpPMID 1234 PMID 1234
!! html/parsoidPMID 1234 PMID 1234
!! end #Xfoo
Xfoo
!! html/parsoidXfoo
Xfoo
!! end !! test Magic links: All disabled (T47942) !! config wgEnableMagicLinks={"ISBN":false, "PMID":false, "RFC":false} !! options cat !! wikitext ISBN 0-306-40615-2 PMID 1234 RFC 4321 !! metadata !! htmlISBN 0-306-40615-2 PMID 1234 RFC 4321
!! end !! test Magic links: html2wt of old wikitext when disabled (T47942) !! config wgEnableMagicLinks={"ISBN":false, "PMID":false, "RFC":false} !! options parsoid=html2wt !! html/parsoidISBN 0-306-40615-2 PMID 1234 RFC 4321
!! wikitext [[Special:BookSources/0306406152|ISBN 0-306-40615-2]] [//www.ncbi.nlm.nih.gov/pubmed/1234?dopt=Abstract PMID 1234] [https://datatracker.ietf.org/doc/html/rfc4321 RFC 4321] !! end # PMID has an interwiki setup (if the pmid-interwiki option is set), but RFC # doesn't. Check that we round-trip correctly from the interwiki format, # whether magic links are enabled or not (and whether the interwiki is # present or not). !! test Prefer PMID magic link, no interwiki and magic links enabled (T145590#8608455) !! wikitext PMID 234 !! html/php !! html/parsoid !! end !! test Prefer PMID magic link, interwiki and magic links enabled (T145590#8608455) !! options pmid-interwiki !! wikitext PMID 234 !! html/php !! html/parsoid !! end !! test Round-trip PMID interwiki, magic links enabled (T145590#8608455) !! options pmid-interwiki !! wikitext [[pmid:234|PMID 234]] !! html/php !! html/parsoid !! end !! test Prefer PMID interwiki, magic links disabled (T145590#8608455) !! options pmid-interwiki !! config wgEnableMagicLinks={"PMID":false,"RFC":false} !! wikitext [[pmid:234|PMID 234]] [https://datatracker.ietf.org/doc/html/rfc4321 RFC 4321] !! html/php !! html/parsoid !! end !! test Preder PMID extlink if no interwiki, magic links disabled (T145590#8608455) !! options parsoid=html2wt !! config wgEnableMagicLinks={"PMID":false,"RFC":false} !! wikitext [//www.ncbi.nlm.nih.gov/pubmed/234?dopt=Abstract PMID 234] !! html/parsoid !! end !! article Foo !! text FOO !! endarticle !! test Magic links inside links (not autolinked) !! wikitext [[Foo|http://example.com]] [[Foo|RFC 1234]] [[Foo|PMID 1234]] [[Foo|ISBN 123456789x]] [http://foo.com http://example.com] [http://foo.com RFC 1234] [http://foo.com PMID 1234] [http://foo.com ISBN 123456789x] !! html/phphttp://example.com RFC 1234 PMID 1234 ISBN 123456789x
http://example.com RFC 1234 PMID 1234 ISBN 123456789x
!! html/parsoidhttp://example.com RFC 1234 PMID 1234 ISBN 123456789x
http://example.com RFC 1234 PMID 1234 ISBN 123456789x
!! end !! test WTS of magic word text (T109371) !! options parsoid=html2wt !! html/parsoidRFC 1234
!! wikitextISBN
!! end !! test Double ISBN !! wikitext ISBN ISBN 1234567890 !! html/phpISBN ISBN 1234567890
!! html/parsoidISBN ISBN 1234567890
!! end # Uppercase X and lowercase x as well !! test ISBN with an X !! wikitext ISBN 3-462-04561-X ISBN 3-462-04561-x ISBN 080442957X ISBN 080442957x ISBN 978080442957X ISBN 978080442957x !! html/phpISBN 3-462-04561-X ISBN 3-462-04561-x ISBN 080442957X ISBN 080442957x ISBN 978080442957X ISBN 978080442957x
!! html/parsoidISBN 3-462-04561-X ISBN 3-462-04561-x ISBN 080442957X ISBN 080442957x ISBN 978080442957X ISBN 978080442957x
!! end !! test ISBN with empty prefix (parsoid test) !! wikitext ISBN 1234567890 !! html/php !! html/parsoid !! end !! test T24905: followed by ISBN followed by !! wikitext (fr) ISBN 2753300917 [http://www.example.com example.com] !! html/php(fr) ISBN 2753300917 example.com
!! html/parsoid(fr) ISBN 2753300917 example.com
!! end !! test Double RFC !! wikitext RFC RFC 1234 !! html/phpRFC RFC 1234
!! html/parsoidRFC RFC 1234
!! end !! test Double RFC with a wiki link !! wikitext RFC [[RFC 1234]] !! html/phpRFC RFC 1234
!! html/parsoidRFC RFC 1234
!! end !! test RFC code coverage !! wikitext RFC 983 987 !! html/phpRFC 983 987
!! html/parsoidRFC 983 987
!! end !! test ISBN with a dummy number !! wikitext ISBN --- !! htmlISBN ---
!! end !! test ISBN with space-delimited number !! wikitext ISBN 92 9017 032 8 !! html/php !! html/parsoid !! end !! test ISBN with multiple spaces, no number !! wikitext ISBN foo !! htmlISBN foo
!! end !! test ISBN length !! wikitext ISBN 123456789 ISBN 1234567890 ISBN 12345678901 !! html/phpISBN 123456789
ISBN 12345678901
!! html/parsoidISBN 123456789
ISBN 12345678901
!! end !! test ISBN with trailing year (T9110) !! wikitext ISBN 1-234-56789-0 - 2006 ISBN 1 234 56789 0 - 2006 !! html/phpISBN 1-234-56789-0 - 2006
ISBN 1 234 56789 0 - 2006
!! html/parsoidISBN 1-234-56789-0 - 2006
ISBN 1 234 56789 0 - 2006
!! end !! test Edited ISBN links not serializable as ISBN links should serialize as wikilinks (magic links enabled) !! options parsoid=html2wt !! html/parsoid ISBN 1234567895 !! wikitext [[Special:BookSources/1234567890|ISBN 1234567895]] !! end !! test Edited ISBN links not serializable as ISBN links should serialize as wikilinks (magic links disabled) !! config wgEnableMagicLinks={"ISBN":false, "PMID":false, "RFC":false} !! options parsoid=html2wt !! html/parsoid ISBN 1234567895 !! wikitext [[Special:BookSources/1234567890|ISBN 1234567895]] !! end !! test Edited RFC links not serializable as RFC links should serialize as extlinks !! options parsoid=html2wt !! html/parsoid New RFC !! wikitext [https://datatracker.ietf.org/doc/html/rfc123 New RFC] !! end !! test Edited PMID links not serializable as PMID links should serialize as extlinks !! options parsoid=html2wt !! html/parsoid New PMID !! wikitext [//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract New PMID] !! end !! test Edited PMID links not serializable as PMID links should serialize as wikilinks if possible !! options parsoid=html2wt pmid-interwiki !! html/parsoid New PMID !! wikitext [[pmid:123|New PMID]] !! end