Skip to content

Commit

Permalink
fix: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
kellyjosephprice committed Feb 10, 2025
1 parent ab8e86c commit 62e719e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion __tests__/migration/emphasis.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('migrating emphasis', () => {
`);
});

it('moves whitespace surrounding phrasing content (emphasis, strong, etc) to the appropriate place', () => {
it.only('moves whitespace surrounding phrasing content (emphasis, strong, etc) to the appropriate place', () => {
const md = '**bold **and also_ italic_ and*** bold italic***aaaaaah';

const mdx = migrate(md);
Expand Down
5 changes: 2 additions & 3 deletions lib/plain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ function one(node: Nodes, opts: Options) {

return [title, body].filter(Boolean).join(' ');
}
default: {
return '';
}
default:
break;
}
}

Expand Down
7 changes: 3 additions & 4 deletions processor/transform/embeds.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Embed, EmbedBlock } from '../../types';
import type { Paragraph, Parents, Node } from 'mdast';
import type { Paragraph, Parents, Node, Text } from 'mdast';

import { visit } from 'unist-util-visit';

Expand All @@ -15,7 +15,7 @@ const embedTransformer = () => {
if (!isEmbed(child)) return;

const { url, title } = child;
const label = mdx(child);
const label = (child.children[0] as Text).value;

const newNode = {
type: NodeTypes.embedBlock,
Expand All @@ -25,7 +25,7 @@ const embedTransformer = () => {
data: {
hProperties: {
url,
title,
title: label ?? title,
},
hName: 'embed',
},
Expand All @@ -38,4 +38,3 @@ const embedTransformer = () => {
};

export default embedTransformer;

0 comments on commit 62e719e

Please sign in to comment.