You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i want render with mathematical expressions. my code is like this and i am using react-native-mathjax library for mathematical expressions. but its does not work. the rules method is not being called. Please give me how to do this its urgent for me.
const CustomMarkdown = ({ content }) => {
// Define custom rules for rendering math
const customRules = {
inline_math: (node, children, parent, styles) => {
console.log('Inline math node:', node); // Debugging log
const content = node.content.replace(/\(/g, "").replace(/\)/g, "");
return (
<MathJax
key={node.key}
html={<span>\\(${content}\\)</span>}
mathJaxOptions={{
messageStyle: 'none',
}}
/>
);
},
block_math: (node, children, parent, styles) => {
console.log('Block math node:', node); // Debugging log
const content = node.content.replace(/\[/g, "").replace(/\]/g, "");
return (
<MathJax
key={node.key}
html={<div>\\[${content}\\]</div>}
mathJaxOptions={{
messageStyle: 'none',
}}
/>
);
},
text: (node, children, parent, styles) => {
console.log('Text node:', node); // Debugging log
return <Text style={{ color: 'red' }}>{node.content};
},
};
return (
<ScrollView style={{ padding: 10 }}>
{content}
);
};
The text was updated successfully, but these errors were encountered:
i want render with mathematical expressions. my code is like this and i am using react-native-mathjax library for mathematical expressions. but its does not work. the rules method is not being called. Please give me how to do this its urgent for me.
const CustomMarkdown = ({ content }) => {
// Define custom rules for rendering math
const customRules = {
inline_math: (node, children, parent, styles) => {
console.log('Inline math node:', node); // Debugging log
const content = node.content.replace(/\(/g, "").replace(/\)/g, "");
return (
<MathJax
key={node.key}
html={
<span>\\(${content}\\)</span>
}mathJaxOptions={{
messageStyle: 'none',
}}
/>
);
},
block_math: (node, children, parent, styles) => {
console.log('Block math node:', node); // Debugging log
const content = node.content.replace(/\[/g, "").replace(/\]/g, "");
return (
<MathJax
key={node.key}
html={
<div>\\[${content}\\]</div>
}mathJaxOptions={{
messageStyle: 'none',
}}
/>
);
},
text: (node, children, parent, styles) => {
console.log('Text node:', node); // Debugging log
return <Text style={{ color: 'red' }}>{node.content};
},
};
return (
<ScrollView style={{ padding: 10 }}>
{content}
);
};
The text was updated successfully, but these errors were encountered: