Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolanrensen committed Feb 1, 2023
1 parent 100dcb8 commit ceb3f75
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ class IncludeArgDocProcessor : TagDocProcessor() {

tagWithContent
} else {
"$content $extraContent"
if (extraContent.isEmpty()) content
else "$content $extraContent"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class IncludeDocProcessor : TagDocProcessor() {
private val tag = "include"

// Regex to match [Aliased][ReferenceLinks].
private val aliasedLinkRegex = Regex("""(\[[^\[]*]\[)([^\[]*)(])""")
private val aliasedLinkRegex = Regex("""(\[[^\[\]]*]\[)([^\[\]]*)(])""")

// Regex to match [ReferenceLinks].
private val singleLinkRegex = Regex("""([^]]\[)([^\[\]]*)(]$|][^\[])""")
Expand Down Expand Up @@ -150,7 +150,11 @@ class IncludeDocProcessor : TagDocProcessor() {
}

var content: DocContent = queried.docContent
.removeSurrounding("\n") + " $extraContent"
.removeSurrounding("\n")

if (extraContent.isNotEmpty()) {
content = "$content $extraContent"
}

// if the content contains links to other elements, we need to expand the path
// providing the original name or alias as new alias.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ class IncludeFileDocProcessor : TagDocProcessor() {
.replace("*/", "*/")
} else {
content
} + " " + extraContent
}.let {
if (extraContent.isNotBlank()) "$it $extraContent"
else it
}
}

override fun processInnerTagWithContent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ class SampleDocProcessor : TagDocProcessor() {
appendLine("```")
}

append(" $extraContent")
if (extraContent.isNotEmpty())
append(" $extraContent")
}
} ?: error(
"SampleDocProcessor ERROR: Sample not found: $samplePath. Called from $path. Attempted queries: [\n${
Expand Down

0 comments on commit ceb3f75

Please sign in to comment.