Test Links

Editor: Michaël Meyer.

Identifier: DHARMA_INSTestLinks.

Language: Sanskrit.

Repository: Test Repository (test).

Version: (1406336), last modified (eca9524).

Edition

ref and ptr have the same purpose and behave the same save for the fact that ref can have contents while ptr cannot. We use the same code for parsing both. Thus, all the following tests exercise identically both elements.

When the ref is empty and has no @target, it should produce nothing at all: ABC.

When the ref is empty and has a @target that doesn’t point to our website, display this URL in monospace: Ahttp://example.comBhttp://example.comC.

Idem with another link: Aftp://ftp.example.comBftp://ftp.example.comC.

When the ref is empty and has a @target that points to something on our website, display the shortened path in monospace (the shortened path is either an absolute URL or a text id) and make the generated @href an absolute path (without scheme and domain names): ABhttps://dharmalekha.infoC.

Idem with another link: AmytextBhttps://dharmalekha.info/texts/mytextC.

Idem with another link: A/textsBhttps://dharmalekha.info/textsC.

Idem with another link: A/foo/barBhttps://dharmalekha.info/foo/barC.

Idem with another link: A/foo/bar/Bhttps://dharmalekha.info/foo/bar/C.

Idem when the URL doesn’t include our domain name (dharmalekha.info); relative paths are resolved relative to the /texts directory: A/B/C.

Idem with another path: AmytextBmytextC.

Idem with another path: A/textsB/textsC.

Idem with another path: A/foo/barB/foo/barC.

Idem with another path: A/foo/bar/B/foo/bar/C.

Idem with another path: Afoo/barBfoo/barC.

When the ref is not empty and has no @target, its contents should be preserved, even though there is no link: AABC.

When the ref is not empty and has a @target, display the ref’s contents in a normal font: AABhttp://example.comC.

Idem with another link: AAB/C.

Idem with another link: AABmytextC.