mirror of https://github.com/mindoc-org/mindoc.git
兼容Markdown导入特殊的链接
parent
d7186ff270
commit
1eae95ea5d
|
@ -715,6 +715,12 @@ func (book *Book) ImportBook(zipPath string) error {
|
|||
originalLink := links[0][2]
|
||||
var linkPath string
|
||||
var err error
|
||||
if strings.HasPrefix(originalLink,"<") {
|
||||
originalLink = strings.TrimPrefix(originalLink,"<")
|
||||
}
|
||||
if strings.HasSuffix(originalLink,">") {
|
||||
originalLink = strings.TrimSuffix(originalLink,">")
|
||||
}
|
||||
//如果是从根目录开始,
|
||||
if strings.HasPrefix(originalLink, "/") {
|
||||
linkPath, err = filepath.Abs(filepath.Join(tempPath, originalLink))
|
||||
|
|
Loading…
Reference in New Issue