Fix headline tags, table pretty printing and multiline links

- we can't just look at the len of the string (~ #bytes) - that breaks down for
  tables containing characters consisting of multiple bytes. This handles
  more (still not all) cases and is good enough for now
- add _ to allowed tag chars - also require space between headline and tags
- links (link itself, not the description) spanning multiple lines are not
  supported - otherwise we would have to take care of splitting link and adding
  indentation for org pretty printing - and that sounds like such an edge case
  that it seems cleaner to forbid them
This commit is contained in:
Niklas Fasching 2018-12-19 12:58:07 +01:00
parent fb837e04af
commit ec895cbe83
7 changed files with 61 additions and 4 deletions

View file

@ -210,6 +210,9 @@ func (d *Document) parseRegularLink(input string, start int) (int, Node) {
if len(rawLinkParts) == 2 {
link, description = rawLinkParts[0], d.parseInline(rawLinkParts[1])
}
if strings.ContainsRune(link, '\n') {
return 0, nil
}
consumed := end + 2
protocol, linkParts := "", strings.SplitN(link, ":", 2)
if len(linkParts) == 2 {