[k1LoW/deck#448] fix link text including underscore is partially missing#449
Conversation
|
|
Your edit is probably correct. Could you please reopen it? |
|
I imagine you've strictly enabled hash pinning, but since the homebrew/actions/setup-homebrew tag doesn't exist, the workflow is broken. Could you please check this? @k1LoW |
|
Sorry! I've disabled it! |
|
thanks, I will check failed test |
|
|
It's recommended to include test cases in the golden tests for clarity. |
md/md.go
Outdated
| // Concatenate all children values for links | ||
| var linkText string | ||
| for _, child := range children { | ||
| linkText += child.Value |
There was a problem hiding this comment.
Here, rather than simply concatenating the text, we need to process each child element by converting it into a fragment and adding it, similar to how we handle emphasis. This is to preserve the styles within the link text.
There was a problem hiding this comment.
thanks, I think so too, and will fix it.
- Changed implementation to create separate fragments for each text node - This preserves formatting (bold, italic, code) within links - Added comprehensive tests for links with underscores and formatting
9367384 to
a42bfb0
Compare
- Replaced all example.com URLs with github.com/k1LoW/deck in link.md.golden - Ensures consistency across all test data
Songmu
left a comment
There was a problem hiding this comment.
Great!
No issues with the code changes.
Please adjust the test code.
- md/link_test.go duplicates the golden test, so let's remove it
- Should we change
[**bold_start** normal_middle **bold_end**]to[**bold_start** normal_middle __bold_end__]?- This time, the issue stemmed from the underscore being a special character in Markdown that triggers token splitting. We want to ensure our test cases cover this scenario as well.
- Remove md/link_test.go as it duplicates golden test functionality - Change **bold_end** to __bold_end__ in test case to better test underscore handling (double underscores also create bold formatting and test token splitting)
thanks, good test case. I fixed for it. |
|
Great work. |
WHAT
SSIA
WHY
link only handled the first fragment (underscore is one of example)
#448
Note
golden test
https://github.com/k1LoW/deck/blob/0e34436b4952af625c8b104f83573e5299897fb2/testdata/link.md