URLs with embedded syntax highlighting convert to malformed link
Official development repository for Vim's builtin TOhtml plugin
Brought to you by:
fritzophrenic
Originally created by: fritzophrenic
Original report by Anonymous.
With the following file:
$ http://202.112.51.227:58314/ $ http://github.com
Run:
vim -X -i NONE -f +"let g:html_no_progress=1" +"let g:html_ignore_folding=1" +"let g:html_use_css=0" +"let g:html_pre_wrap=0" +"TOhtml" -ncwqa a.sh
Got the following results:
</head> <body bgcolor="#ffffff" text="#000000" onload='JumpToLine();'> <font face="monospace"> <span id="L1" ><font color="#af5fd7">1 </font></span>$ <a href="http://">http://</a><font color="#c00000">202</font>.<font color="#c00000">112</font>.<font color="#c00000">51</font>.227:58314/<br> <span id="L2" ><font color="#af5fd7">2 </font></span>$ <a href="http://github.com">http://github.com</a><br> <span id="L3" ><font color="#af5fd7">3 </font></span><br> </font> </body>
It can be seen that, the URL with IP address was not recognized and parsed correctly.
Originally posted by: fritzophrenic
Original comment by Yuxin Wu (Bitbucket: ppwwyyxx, GitHub: ppwwyyxx).
Sorry, forgot to login before posting. I don’t know Bitbucket allows that 😅
Adding
+"hi clear Constant"
can workaround it.I think I’ll need to rework how the links are processed if embedding formatting within the links is needed so this won’t be easy. Right now IIRC it’s just a simple :substitute command that runs after the conversion is done.
Diff: