Skip to content

Commit

Permalink
Merge pull request #373 from fmasa/style-fix
Browse files Browse the repository at this point in the history
Core Rulebook: Fix minor import issues
  • Loading branch information
fmasa authored Nov 18, 2024
2 parents c9ed187 + 551584d commit c7e85c3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -379,15 +379,15 @@ object CoreRulebook :
}

override fun resolveToken(textToken: TextToken): Token? {
if (textToken.fontName == "CaslonAntique" && textToken.fontSizePt == 15f) {
if (textToken.fontName.endsWith("CaslonAntique") && textToken.fontSizePt == 15f) {
return Token.BoxHeader(textToken.text)
}

if (textToken.fontName == "CaslonAntique" && textToken.fontSizePt == 10f) {
if (textToken.fontName.endsWith("CaslonAntique") && textToken.fontSizePt == 10f) {
return Token.BoxContent(textToken.text)
}

if (textToken.fontName == "CaslonAntique,Bold") {
if (textToken.fontName.endsWith("CaslonAntique,Bold")) {
if (textToken.fontSizePt == 19f) {
return Token.Heading1(textToken.text)
}
Expand All @@ -401,7 +401,7 @@ object CoreRulebook :
return Token.CrossIcon
}

if (textToken.fontName == "CaslonAntique-Bold-SC700") {
if (textToken.fontName.endsWith("CaslonAntique-Bold-SC700")) {
if (textToken.fontSizePt == 12f || textToken.fontSizePt == 18f) {
return Token.Heading2(textToken.text)
}
Expand All @@ -413,16 +413,16 @@ object CoreRulebook :
return Token.Heading3(textToken.text)
}

if (textToken.fontName.endsWith("HPBTHP+ACaslonPro-Regular") && textToken.text.startsWith("")) {
if (textToken.text.startsWith("")) {
return Token.BulletPoint
}

if (textToken.fontSizePt == 9.0f) {
if (textToken.fontName == "ACaslonPro-Bold") {
if (textToken.fontName.endsWith("ACaslonPro-Bold")) {
return Token.BoldPart(textToken.text)
}

if (textToken.fontName == "ACaslonPro-Regular") {
if (textToken.fontName.endsWith("ACaslonPro-Regular")) {
if (heightEquals(textToken.height, 6.39f)) {
return Token.ItalicsPart(textToken.text)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import arrow.core.NonEmptyList
import arrow.core.nonEmptyListOf

object MarkdownBuilder {
private const val BULLET_POINT_PLACEHOLDER = "<bullet-point>"
private const val BULLET_POINT_PLACEHOLDER = ""

fun buildMarkdown(tokens: List<Token.ParagraphToken>): String {
val flattened = mutableListOf<NonEmptyList<Token.ParagraphToken>>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ object TextCleaner {
.replace("( ", "(")
.replace(" )", ")")
.replace(" ,", ",")
.replace("\t", " ")
}

0 comments on commit c7e85c3

Please sign in to comment.