You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for reading this issue, and happy Chinese New Year
Environment
OS: Windows 10
Pandoc Version:
PS C:\Users\mjc\git\FictionDown\release> pandoc -v
pandoc.exe2.9.2
Compiled with pandoc-types 1.20, texmath 0.12.0.1, skylighting 0.8.3.2Default user data directory: C:\Users\mjc\AppData\Roaming\pandoc
Copyright (C) 2006-2019 John MacFarlane
Web: https://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.
Input File
This is part of my Markdown file, generated by one of my Golang programs
See this:ma6254/FictionDown#14
PS C:\Users\mjc\git\FictionDown\release> pandoc -o a.epub 诡秘之主.md
pandoc.exe: C:_cover_703999991.jpg: openBinaryFile: does not exist (No such file or directory)
PS C:\Users\mjc\git\FictionDown\release> pandoc -o a.epub 诡秘之主.md
pandoc.exe: C:_cover_703999991.jpg: openBinaryFile: does not exist (No such file or directory)
The error happened again
In Golang
package main
import (
"fmt""log""gopkg.in/yaml.v2"
)
vardata=`a: C:\Users\mjc\AppData\Local\Temp\book_cover_703999991.jpgb: C:\\Users\\mjc\\AppData\\Local\\Temp\\book_cover_703999991.jpgc: "C:\\Users\\mjc\\AppData\\Local\\Temp\\book_cover_703999991.jpg"`// Note: struct fields must be public in order for unmarshal to// correctly populate the data.typeTstruct {
AstringBstringCstring
}
funcmain() {
t:=T{}
err:=yaml.Unmarshal([]byte(data), &t)
iferr!=nil {
log.Fatalf("error: %v", err)
}
fmt.Printf("--- t:\n%#v\n\n", t)
d, err:=yaml.Marshal(&t)
iferr!=nil {
log.Fatalf("error: %v", err)
}
fmt.Printf("--- t dump:\n%s\n\n", string(d))
m:=make(map[interface{}]interface{})
err=yaml.Unmarshal([]byte(data), &m)
iferr!=nil {
log.Fatalf("error: %v", err)
}
fmt.Printf("--- m:\n%#v\n\n", m)
d, err=yaml.Marshal(&m)
iferr!=nil {
log.Fatalf("error: %v", err)
}
fmt.Printf("--- m dump:\n%s\n\n", string(d))
}
ma6254
changed the title
Which is the YAML standard? Windows file path in metadata
Which one is the YAML standard? Windows file path in metadata
Feb 18, 2020
Remember, pandoc parses these fields as Markdown. And Pandoc's Markdown enables raw tex by default. \Temp, \Book, etc. are being parsed as raw tex components. These are then omitted in non-tex output.
The version with unquoted backslashes works, because the \\ is passed through to the Markdown parser, which recognizes it as an escaped backslash and hence doesn't parse raw tex.
The quoted version doesn't work, because here the YAML parser is interpreting the \\, and by the time pandoc's Markdown parser gets to it it's just a single \.
Hope that clears things up. now, what's the solution?
Thank you for reading this issue, and happy Chinese New Year
Environment
OS: Windows 10
Pandoc Version:
Input File
This is part of my Markdown file, generated by one of my Golang programs
See this:ma6254/FictionDown#14
An error occurred
Try to convert to epub
If you modify it like this
There is no problem, but modify it like this
The error happened again
In Golang
output:
So which is the YAML standard, is it escaped or not?
I'm not sure which one is the universal standard
The text was updated successfully, but these errors were encountered: