Skip to content

Commit

Permalink
Ensure no comment data is persisted
Browse files Browse the repository at this point in the history
  • Loading branch information
bhaze31 committed Jan 28, 2024
1 parent 80a52cd commit a4785ed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Sources/Evergreen/EvergreenProcessor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -695,8 +695,10 @@ public class EvergreenProcessor {
let range = line.fullRange
let trimmed = line.trim()

if isFirstLine && trimmed.isMatching(metadataWrapperMatch) {
inMeta = true
if trimmed.isMatching(metadataWrapperMatch) {
if isFirstLine {
inMeta = true
}
} else if inMeta && trimmed.isMatching(metadataContentMatch) {
parseMetaData(trimmed)
} else if line.isMatching(horizontalMatch, in: range) {
Expand Down
6 changes: 5 additions & 1 deletion Tests/EvergreenTests/EvergreenProcessorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,9 @@ final class EvergreenProcessorTests: XCTestCase {
"/ description: How to create an Evergreen document, a markup extension",
"/ slug: intro-to-evergreen-docs",
"/ tags: swift, vapor",
"/=="
"/==",
"",
"# Hey now"
]

let processor = EvergreenProcessor(lines: lines)
Expand All @@ -690,6 +692,8 @@ final class EvergreenProcessorTests: XCTestCase {
XCTAssertEqual(document.metadata.slug, "intro-to-evergreen-docs")
XCTAssertEqual(document.metadata.description, "How to create an Evergreen document, a markup extension")
XCTAssertEqual(document.metadata.tags, ["swift", "vapor"])

XCTAssertEqual(document.content.count, 1)
}

func testGeneratesSlugFromTitle() {
Expand Down

0 comments on commit a4785ed

Please sign in to comment.