bugfix: RST parser: URLs properly parsed
This commit is contained in:
parent
073323af48
commit
232ab71f20
2 changed files with 9 additions and 1 deletions
|
|
@ -608,9 +608,16 @@ proc parseSmiley(p: var TRstParser): PRstNode =
|
||||||
result.text = val
|
result.text = val
|
||||||
return
|
return
|
||||||
|
|
||||||
|
when false:
|
||||||
|
const
|
||||||
|
urlChars = {'A'..'Z', 'a'..'z', '0'..'9', ':', '#', '@', '%', '/', ';',
|
||||||
|
'$', '(', ')', '~', '_', '?', '+', '-', '=', '\\', '.', '&',
|
||||||
|
'\128'..'\255'}
|
||||||
|
|
||||||
proc isURL(p: TRstParser, i: int): bool =
|
proc isURL(p: TRstParser, i: int): bool =
|
||||||
result = (p.tok[i+1].symbol == ":") and (p.tok[i+2].symbol == "//") and
|
result = (p.tok[i+1].symbol == ":") and (p.tok[i+2].symbol == "//") and
|
||||||
(p.tok[i+3].kind == tkWord) and (p.tok[i+4].symbol == ".")
|
(p.tok[i+3].kind == tkWord) and
|
||||||
|
(p.tok[i].symbol in ["http", "ftp", "gopher", "telnet", "file"])
|
||||||
|
|
||||||
proc parseURL(p: var TRstParser, father: PRstNode) =
|
proc parseURL(p: var TRstParser, father: PRstNode) =
|
||||||
#if p.tok[p.idx].symbol[strStart] == '<':
|
#if p.tok[p.idx].symbol[strStart] == '<':
|
||||||
|
|
|
||||||
1
todo.txt
1
todo.txt
|
|
@ -2,6 +2,7 @@ version 0.9.0
|
||||||
=============
|
=============
|
||||||
|
|
||||||
- implement 'gorge'
|
- implement 'gorge'
|
||||||
|
- implement a warning message for shadowed 'result' variable
|
||||||
- make templates hygienic by default: try to gensym() everything in the 'block'
|
- make templates hygienic by default: try to gensym() everything in the 'block'
|
||||||
of a template
|
of a template
|
||||||
- ``bind`` for overloaded symbols does not work apparently
|
- ``bind`` for overloaded symbols does not work apparently
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue