Gemtext: just trim most whitespaces for simplicity
This commit is contained in:
parent
6381e40208
commit
12c3a9e4bb
|
@ -57,8 +57,8 @@ private fun parseLine(line: CharBuffer, isPreformatted: Boolean): Line =
|
||||||
line.startsWith("* ") -> ListItemLine(getCharsFrom(line, 2))
|
line.startsWith("* ") -> ListItemLine(getCharsFrom(line, 2))
|
||||||
line.startsWith("=>") -> getCharsFrom(line, 2)
|
line.startsWith("=>") -> getCharsFrom(line, 2)
|
||||||
.split(" ", limit = 2)
|
.split(" ", limit = 2)
|
||||||
.run { LinkLine(get(0), if (size == 2) get(1) else "") }
|
.run { LinkLine(get(0), if (size == 2) get(1).trimStart() else "") }
|
||||||
else -> if (isPreformatted) PreTextLine(line.toString()) else ParagraphLine(line.toString())
|
else -> if (isPreformatted) PreTextLine(line.toString()) else ParagraphLine(line.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getCharsFrom(line: CharBuffer, index: Int) = line.substring(index).trimStart()
|
private fun getCharsFrom(line: CharBuffer, index: Int) = line.substring(index).trim()
|
Reference in a new issue