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: emphasis with links #1007

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

kellyjosephprice
Copy link
Collaborator

@kellyjosephprice kellyjosephprice commented Oct 29, 2024

PR App Ref CX-1238

🧰 Changes

Fixes emphasis with links in it.

The original implementation of this was naively assuming there would only be one child node. Ope.

🧬 QA & Testing

@kellyjosephprice kellyjosephprice changed the base branch from next to feat/compat-parser October 29, 2024 23:19
@kellyjosephprice kellyjosephprice marked this pull request as ready for review October 30, 2024 16:56
@@ -27,24 +27,40 @@ const trimEmphasis = (node: Emphasis | Strong, index: number, parent: Parent) =>
let trimmed = false;

visit(node, 'text', (child: Text) => {
const newValue = child.value.trim();
const newValue = child.value.trimStart();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we have to trim the start and end separately? Oh I see now! In cases where there are multiple nodes!

@kellyjosephprice kellyjosephprice merged commit d3a8ed9 into feat/compat-parser Oct 30, 2024
13 checks passed
@kellyjosephprice kellyjosephprice deleted the fix/emphasis-with-links branch October 30, 2024 20:33
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.

2 participants