Isolate nuances marker
This commit is contained in:
parent
92ead8b7c2
commit
3a0141e34d
1 changed files with 9 additions and 1 deletions
|
|
@ -78,7 +78,15 @@ class PTemplate (val template: String, val separatorAfter: String, private val m
|
|||
continue
|
||||
}
|
||||
|
||||
val matchedMarker = allStaticMarkers.find { remaining.startsWith(it, ignoreCase = true) }
|
||||
val matchedMarker = allStaticMarkers
|
||||
.sortedByDescending { it.length }
|
||||
.find { marker ->
|
||||
remaining.startsWith(marker, ignoreCase = true) &&
|
||||
(remaining.length == marker.length ||
|
||||
!remaining[marker.length].isLetter())
|
||||
}
|
||||
|
||||
|
||||
if (matchedMarker != null) {
|
||||
tokens.add(matchedMarker)
|
||||
remaining = remaining.substring(matchedMarker.length)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue