Skip to content

Improve tests embebbing#40

Open
Vladyslav-Kuksiuk wants to merge 8 commits into
masterfrom
improve-tests-embebbing
Open

Improve tests embebbing#40
Vladyslav-Kuksiuk wants to merge 8 commits into
masterfrom
improve-tests-embebbing

Conversation

@Vladyslav-Kuksiuk
Copy link
Copy Markdown
Collaborator

@Vladyslav-Kuksiuk Vladyslav-Kuksiuk commented May 26, 2026

This PR improves pattern-based embedding by adding explicit multi-line matching for start, end and line patterns. Instead of requiring a single source line to identify a fragment boundary, patterns can now use \n to match consecutive source lines.

For example:

<embed-code
  file="$test/JunitTest.java"
  start="Test \n adds two values"
  end="assertEquals(2, value); \n }"
/>
```java
@Test
@DisplayName("adds two values")
void addsTwoValues() {
    int value = 1 + 1;

    assertEquals(2, value);
}
```

Each line in a multi-line pattern follows the same glob rules as regular one-line patterns, including ^ and $ for exact matching.

Spaces around \n are ignored.

Additional change: added possibility to write quote characters in patterns as \" instead of the XML entity &quot;.

Resolves SpineEventEngine/embed-code-jekyll#22.

@Vladyslav-Kuksiuk Vladyslav-Kuksiuk self-assigned this May 26, 2026
@Vladyslav-Kuksiuk Vladyslav-Kuksiuk marked this pull request as ready for review May 26, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support embedding JUnit test methods

1 participant