Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/changes/changes_4.10.0.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,6 +12,10 @@ Each release now includes an SPDX 3 SBOM for the product JAR and a SHA-256 check

* #542: CI and releases now provide an SPDX 3 SBOM.

## Bugfixes

* #582: Fixed the Markdown importer silently dropping all specification items after a fenced code block that directly follows a section title.

## Documentation

* #579: Documented planned deprecations and removals.
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,6 +63,7 @@ protected Transition[] configureTransitions()
transition(TITLE , TITLE , MdPattern.UNDERLINE , () -> {} ),
transition(TITLE , TITLE , MdPattern.EMPTY , () -> {} ),
transition(TITLE , START , MdPattern.FORWARD , () -> {forward(); resetTitle();} ),
transition(TITLE , CODE_BLOCK , MdPattern.CODE_BEGIN , this::resetTitle ),
transition(TITLE , START , MdPattern.EVERYTHING , this::resetTitle ),

transition(SPEC_ITEM , SPEC_ITEM , MdPattern.ID , this::beginItem ),
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -242,6 +242,32 @@ void testWhenInsideMarkdownCodeBlockThenNoSpecificationItemMustBeDetected(final
emptyIterable());
}

@Test
void testWhenCodeBlockDirectlyFollowsTitleThenFollowingSpecificationItemMustBeDetected()
{
assertImport("code_block_after_title.md", """
## A diagram before any requirement

```mermaid
graph TD
A --> B
```

`req~example~1`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think adding a second requirement for safety here would be good to prove that the next ones are not dropped.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added req~example~2 right after — the test now asserts both items are detected.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Perfect.


`req~example~2`
""",
contains(
item()
.id(SpecificationItemId.parseId("req~example~1"))
.location("code_block_after_title.md", 8)
.build(),
item()
.id(SpecificationItemId.parseId("req~example~2"))
.location("code_block_after_title.md", 10)
.build()));
}

@ParameterizedTest
@CsvSource(
{
Expand Down
Loading