Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix endSnippet block getting removed for missing snippet #397

Merged

Conversation

mysticmind
Copy link
Contributor

@mysticmind mysticmind commented Jun 1, 2021

  • Fix endSnippet block getting removed for a missing snippet with
    config InPlaceOverwrite
  • Wrap ** Count not find snippet... in a fenced code block.

- Fix endSnippet block getting removed for a missing snippet with
config InPlaceOverwrite
- Wrap the ** Count not find snippet in a fenced code block.
@mysticmind
Copy link
Contributor Author

mysticmind commented Jun 1, 2021

The problem is outlined below:
In markdown, the following is the content with InPlaceOverwrite:

<!-- snippet: sample_FindJsonUserByUsername -->
<!-- endSnippet -->

When I run mdsnippets tool or via msbuild for a missing snippet, it strips off <!-- endSnippet --> as below:

<!-- snippet: sample_FindJsonUserByUsername -->
** Could not find snippet 'sample_FindJsonUserByUsername' **

This PR fixes the same.

I couldn't figure out a way to add unit tests for this case, please provide some clues, I will try to add the same.

FYI, I am using MarkdownSnippets for Marten v4 docs which is currently being worked upon by me.

@SimonCropp
Copy link
Owner

can u add a test to verify this change

@mysticmind
Copy link
Contributor Author

I couldn't figure out a way to add unit tests for this case, please provide some clues, I will try to add the same.

I had added the above in my comment, still checking to see how to add a unit test.

@mysticmind
Copy link
Contributor Author

@SimonCropp I am closing this PR for now. I am able to reproduce the issue using the latest NuGet version 23.1.3. But not on the latest codebase on Git.

@mysticmind mysticmind closed this Jun 1, 2021
@mysticmind
Copy link
Contributor Author

I was able to reproduce this in the latest code in repo, I am committing the test shortly for your review.

@mysticmind mysticmind reopened this Jun 1, 2021
@mysticmind
Copy link
Contributor Author

mysticmind commented Jun 1, 2021

@SimonCropp the PR is ready for your review and next steps. Also it would be super helpful if you could release it to NuGet at the earliest once you confirm this PR is good. Thank you!

@SimonCropp SimonCropp added this to the 23.1.4 milestone Jun 1, 2021
@SimonCropp SimonCropp added the Bug label Jun 1, 2021
@SimonCropp SimonCropp merged commit 8770f70 into SimonCropp:master Jun 1, 2021
@SimonCropp
Copy link
Owner

thanks. deployed

@mysticmind mysticmind deleted the fix_end_snippet_block_removal branch June 1, 2021 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants