Skip to content

Commit

Permalink
Add the pseudo-protocol `lang', which generates a
Browse files Browse the repository at this point in the history
span with a `lang=` attribute.
  • Loading branch information
David Parsons committed Mar 25, 2010
1 parent 34f491e commit b7be677
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion generate.c
Expand Up @@ -468,9 +468,10 @@ static linkytype linkt = { 0, 0, "<a href=\"", "\"",
*/
static linkytype specials[] = {
{ "id:", 3, "<a id=\"", "\"", 0, ">", "</a>", 0, IS_URL },
{ "class:", 6, "<span class=\"", "\"", 0, ">", "</span>", 0, 0 },
{ "raw:", 4, 0, 0, 0, 0, 0, DENY_HTML, 0 },
{ "lang:", 5, "<span lang=\"", "\"", 0, ">", "</span>", 0, 0 },
{ "abbr:", 5, "<abbr title=\"", "\"", 0, ">", "</abbr>", 0, 0 },
{ "class:", 6, "<span class=\"", "\"", 0, ">", "</span>", 0, 0 },
} ;

#define NR(x) (sizeof x / sizeof x[0])
Expand Down
2 changes: 2 additions & 0 deletions tests/pseudo.t
Expand Up @@ -9,6 +9,8 @@ try '[](id:) links' '[foo](id:bar)' '<p><a id="bar">foo</a></p>'
try -fnoext '[](id:) links with -fnoext' '[foo](id:bar)' '<p>[foo](id:bar)</p>'
try '[](class:) links' '[foo](class:bar)' '<p><span class="bar">foo</span></p>'
try -fnoext '[](class:) links with -fnoext' '[foo](class:bar)' '<p>[foo](class:bar)</p>'
try '[](lang:) links' '[foo](lang:en)' '<p><span lang="en">foo</span></p>'
try -fnoext '[](lang:) links with -fnoext' '[foo](lang:en)' '<p>[foo](lang:en)</p>'
try '[](raw:) links' '[foo](raw:bar)' '<p>bar</p>'
try -fnoext '[](raw:) links with -fnoext' '[foo](raw:bar)' '<p>[foo](raw:bar)</p>'

Expand Down

0 comments on commit b7be677

Please sign in to comment.