mirror of
https://github.com/bendtherules/react-to-markdown.git
synced 2026-08-18 22:03:20 +00:00
tagHandler - Handle blockquote, only with plain text
This commit is contained in:
@@ -155,3 +155,10 @@ test('should render link with only title', () => {
|
|||||||
test('should render link without title and text', () => {
|
test('should render link without title and text', () => {
|
||||||
expect((render(<a href="./test" />) as string).trim()).toBe('[](./test)');
|
expect((render(<a href="./test" />) as string).trim()).toBe('[](./test)');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('should render blockquote with plain text', () => {
|
||||||
|
expect((render(<blockquote>some text</blockquote>) as string).trim()).toBe(
|
||||||
|
'> some text'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
|
blockquote,
|
||||||
emphasis,
|
emphasis,
|
||||||
heading,
|
heading,
|
||||||
image,
|
image,
|
||||||
@@ -89,6 +90,13 @@ export default function handleTag(
|
|||||||
}
|
}
|
||||||
// END - Handle anchor tag (link)
|
// END - Handle anchor tag (link)
|
||||||
|
|
||||||
|
// START - Handle blockquote
|
||||||
|
case 'blockquote': {
|
||||||
|
newParentASTNode = childASTNode = blockquote();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// END - Handle blockquote
|
||||||
|
|
||||||
default:
|
default:
|
||||||
newParentASTNode = parentASTNode;
|
newParentASTNode = parentASTNode;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user