Curly Brace Symbol Doesn't Show
saraOrkide opened this issue · comments
I want to parse the mml, but when it comes to the mfenced tag, the value of the open attribute changes from "}" to "true".
I used the latest version and set sanitize for it, but it didn't work
example mml:
<div class='chistaItem' style='text-align:right;/*MARK-BY-CHISTA-PARSER*/direction:rtl;/*MARK-BY-CHISTA-PARSER*/'><span class='chistaText'> متناظر با هر عبارت، یک مجموعه و متناظر با هر مجموعه، یک عبارت بنویسید و تعداد عضوهای هر مجموعه را تعیین کنید. </span></div><div class='chistaItem' style='text-align:right;/*MARK-BY-CHISTA-PARSER*/direction:rtl;/*MARK-BY-CHISTA-PARSER*/'><span class='chistaText'> الف) <span class="chistaFormula"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline-block"><mi>A</mi><mo>=</mo><mfenced open="{" close="}" separators="|"><mrow><mn>1,8</mn><mo>,</mo><mn>27,64,125</mn></mrow></mfenced></math></span> </span></div><div class='chistaItem' style='text-align:right;/*MARK-BY-CHISTA-PARSER*/direction:rtl;/*MARK-BY-CHISTA-PARSER*/'><span class='chistaText'> ب) <span class="chistaFormula"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline-block"><mi>C</mi><mo>=</mo><mfenced open="{" close="}" separators="|"><mrow><mn>10</mn></mrow></mfenced></math></span> </span></div><div class='chistaItem' style='text-align:right;/*MARK-BY-CHISTA-PARSER*/direction:rtl;/*MARK-BY-CHISTA-PARSER*/'><span class='chistaText'> ج) عددهای طبیعی مضرب <span class="chistaFormula"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline-block"><mn>5</mn></math></span> و کوچکتر از <span class="chistaFormula"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline-block"><mn>100</mn></math></span> </span></div><div class='chistaItem' style='text-align:right;/*MARK-BY-CHISTA-PARSER*/direction:rtl;/*MARK-BY-CHISTA-PARSER*/'><span class='chistaText'> د) عددهای طبیعی بزرگتر از <span class="chistaFormula"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline-block"><mn>4</mn></math></span> و کوچکتر از <span class="chistaFormula"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline-block"><mn>5</mn></math></span> </span></div><div class='chistaItem' style='text-align:right;/*MARK-BY-CHISTA-PARSER*/direction:rtl;/*MARK-BY-CHISTA-PARSER*/'><span class='chistaText'> هـ) عددهای صحیح منفی که بین <span class="chistaFormula"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline-block"><mn>4</mn></math></span> و <span class="chistaFormula"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline-block"><mn>7</mn></math></span> قرار دارد. </span></div><div class='chistaItem' style='text-align:right;/*MARK-BY-CHISTA-PARSER*/direction:rtl;/*MARK-BY-CHISTA-PARSER*/'><span class='chistaText'> و) عددهای اول دو رقمی که مضرب <span class="chistaFormula"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline-block"><mi>r</mi></math></span> باشد. </span></div>
Generally, it sets the value of the open attribute to true
@saraOrkide can you provide a reproducible example using CodeSandbox JavaScript or CodeSandbox TypeScript?
@saraOrkide can you provide a reproducible example using CodeSandbox JavaScript or CodeSandbox TypeScript?
@saraOrkide I don't see your changes. Can you fork and save a new CodeSandbox?
@saraOrkide I don't see your changes. Can you fork and save a new CodeSandbox?
Oh sorry, forgot to save
see now
@saraOrkide can you share the new link that was created after save?
@saraOrkide can you share the new link that was created after save?
https://codesandbox.io/s/laughing-dhawan-sq5p28?file=/src/index.js
I reproduced your issue and it's caused by the open
prop being converted to a boolean value:
I think the fix will need to be done in https://github.com/remarkablemark/react-dom-core/tree/master/packages/react-property
Actually this is a React bug, I can reproduce in https://codesandbox.io/s/html-react-parser-1080-23nhj2
Ok, I know, why does it convert it to boolean?
How can I solve the problem?
with react-property?!!
Can you please tell me with the sample code that I sent
@saraOrkide unfortunately there is nothing I can do on my side since this is a React bug. See reproduced demo
My recommendation is to stick with dangerouslySetInnerHTML
My recommendation is to stick with
dangerouslySetInnerHTML
My problem is that I want to replace a tag, so I wanted to use html-react-parser
You can use dangerouslySetInnerHTML
with html-react-parser
You can use
dangerouslySetInnerHTML
withhtml-react-parser
Can you tell me how?