-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Windows] --syntax-definition thinks absolute file paths are protocols #4836
Comments
Your nonworking command is
pandoc test.md --to=html5 -o test.html --syntax-definition=%cd%\test-syn-def.xml
It would be more helpful to have a failing command where %cd%
is filled in with its actual value.
We have some code already that tries to distinguish
between URLs and windows full paths, but it may need
tweaking.
|
If this is an issue, I think it is actually in Skylighting, specifically: http://hackage.haskell.org/package/skylighting-core/docs/src/Skylighting.Parser.html#application |
Ah yes. So, it's really readDocument from HXT that is
throwing the error?
If so, we probably can't do much about it, but one
might ask the HXT maintainer.
Mauro Bieg <notifications@github.com> writes:
… If this is an issue, I think it is actually in [Skylighting](https://github.com/jgm/skylighting), specifically: http://hackage.haskell.org/package/skylighting-core/docs/src/Skylighting.Parser.html#application
|
Thanks for a taking a look at this. Re. Anyway, @mb21 is most likely right about it being specific to Skylighting and therefore HXT. I'll see if I can get time to investigate more on the HXT side and open an issue there. |
I don't see anything we can do about this on our end. You could submit an issue to https://github.com/UweSchmidt/hxt. The part of the code in question is
We work around this problem in pandoc by using a special wrapper: see -- | Specialized version of parseURIReference that disallows
-- single-letter schemes. Reason: these are usually windows absolute
-- paths.
parseURIReference' :: String -> Maybe URI
parseURIReference' s =
case parseURIReference s of
Just u
| length (uriScheme u) > 2 -> Just u
| null (uriScheme u) -> Just u -- protocol-relative
_ -> Nothing HXT could do something similar to fix this problem. |
Great, I'll write an issue on HXT. Thanks! |
Great! If you could put a link to it here, that would
be helpful.
|
HXT may no longer be an active project. Perhaps the solution is to rewrite this code in skylighting using conduit-xml or xml-light. |
Or, simpler, just use |
Otherwise HXT will take it to be a URI. See jgm/pandoc#4836.
I think I found a simple fix in pandoc itself. Can you test? Not easy for me to test on Windows. |
does not work on windows, also does not work with http links |
@econwang can you give more information? You tested what version of pandoc, with what exact command, and what results? |
|
If the
--syntax-definition
option is given an absolute windows file path, it will error withfatal error: unsupported protocol in URI
. It seems to be thinking that there is a protocol specification in the path (presumably because of the colon). I could not find this error with a few other options (e.g.--output
), which is strange. There is a repro here: https://github.com/adamschoenemann/pandoc-bug-reproPandoc version is 2.2.3.2
The text was updated successfully, but these errors were encountered: