Fix embedded notes not generating proper reference links #1286
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed when generating reference links for a note that includes embedded notes, the reference links have a syntax error.
![before](https://private-user-images.githubusercontent.com/8953212/268160202-b25b4037-3f2b-4650-9985-f40dac4dc256.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4Njg3NDgsIm5iZiI6MTczODg2ODQ0OCwicGF0aCI6Ii84OTUzMjEyLzI2ODE2MDIwMi1iMjViNDAzNy0zZjJiLTQ2NTAtOTk4NS1mNDBkYWM0ZGMyNTYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDZUMTkwMDQ4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MmY2MTllODY5MjdlNjU1ZmQyYzQ1YjgxNjJlZmY1NjIyYmM2MGI1MWYwNzc1NzdkZGY0NmM0MTA0YjFkZGEzMSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.Z20Cb4kJemNfY6nfbZ-6VJEm6y0JC3h4R6RV7eBjiqM)
This is caused by an off-by-one error when extracting the label after gathering the links for a note since embedded notes have an extra
!
.After the fix:
![after](https://private-user-images.githubusercontent.com/8953212/268160309-755041eb-d63c-49ec-9010-6fee40c4f9a6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4Njg3NDgsIm5iZiI6MTczODg2ODQ0OCwicGF0aCI6Ii84OTUzMjEyLzI2ODE2MDMwOS03NTUwNDFlYi1kNjNjLTQ5ZWMtOTAxMC02ZmVlNDBjNGY5YTYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDZUMTkwMDQ4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NjE4MjBmMWRiM2Y5MjVkOTU2MjM4ZTM5NmJlZTMyNWEwMjI5ZTIyNDc2ZjFkN2Y1MDkyODAyNWQ5OTMxYjMyZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.w-pXqRe2Pyou39hAZNS5RhawmbpBLEna3pVgcgFIO_E)
Appreciate any feedback!