diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-08-05 06:17:24 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-08-05 06:17:24 +0200 |
commit | 98c6d867fd1e874b756962575e2d9b30ca20ca1f (patch) | |
tree | 693bc12e78f1ba7ab839920a19a8562fc6835229 | |
parent | 684cf70857e78a209a794c6a699e7022c7c5ab0c (diff) | |
download | plan9front-98c6d867fd1e874b756962575e2d9b30ca20ca1f.tar.xz |
wikifmt: more complete title to name= anchor translation
-rw-r--r-- | sys/src/cmd/aux/wikifmt.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/src/cmd/aux/wikifmt.c b/sys/src/cmd/aux/wikifmt.c index a28e5e2d6..935dc40b2 100644 --- a/sys/src/cmd/aux/wikifmt.c +++ b/sys/src/cmd/aux/wikifmt.c @@ -190,10 +190,20 @@ heading(void) if((*pos >= 'a' && *pos <= 'z') || (*pos >= 'A' && *pos <= 'Z') || (*pos >= '0' && *pos <= '9') - || (*pos == '-')) + || (strchr("!#$%&()_+,-./{|}~:;=?@[\\]^_`", *pos) != 0)) output(pos, 1); - else + else if(*pos == ' ' || *pos == '\t') output("_", 1); + else if(*pos == '<') + output("<", 4); + else if(*pos == '>') + output(">", 4); + else if(*pos == '&') + output("&", 5); + else if(*pos == '"') + output(""", 6); + else if(*pos == '\'') + output("'", 5); pos++; } string("\"></a>"); |