You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2023/01/19 14:15:51 UTC

[GitHub] [echarts] minren118 opened a new issue, #18192: [Bug] 使用getDataURL方法获取svg文本时,当有<符号时,没进行转义破坏了xml文档结构

minren118 opened a new issue, #18192:
URL: https://github.com/apache/echarts/issues/18192

   ### Version
   
   5.3
   
   ### Link to Minimal Reproduction
   
   _No response_
   
   ### Steps to Reproduce
   
   当使用getDataURL对图表进行svg文本输出时,发现ECharts没有对特殊的符号如<进行转义再输出,导致导出的svg文本出错。
   浏览器打开会显示这样的标识,实际的内容没法渲染出来。
   ![image](https://user-images.githubusercontent.com/28550438/213464600-0f5799de-85ae-43fc-b29c-b1ec94fa9d41.png)
   
   实际内容如下:因<破坏了xml文档结构。
   ![image](https://user-images.githubusercontent.com/28550438/213464627-d9046b99-5fef-49c9-8e59-9c8304db4dfa.png)
   
   当转义后,就正常了。
   <text dominant-baseline="central" text-anchor="start" style="font: normal normal 14px Microsoft YaHei" x="30" y="7.5" transform="translate(85 520)" fill="#333">&lt;5</text>
   
   ### Current Behavior
   
   未对导出的字符串进行转义。
   
   ### Expected Behavior
   
   需要对导出的字符串包含特殊字符时,转义后再输出。
   
   ### Environment
   
   ```markdown
   - OS:
   - Browser:
   - Framework:
   ```
   
   
   ### Any additional comments?
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] echarts-bot[bot] closed issue #18192: [Bug] 使用getDataURL方法获取svg文本时,当有<符号时,没进行转义破坏了xml文档结构

Posted by echarts-bot.
echarts-bot[bot] closed issue #18192: [Bug] 使用getDataURL方法获取svg文本时,当有<符号时,没进行转义破坏了xml文档结构
URL: https://github.com/apache/echarts/issues/18192


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] echarts-bot[bot] commented on issue #18192: [Bug] 使用getDataURL方法获取svg文本时,当有<符号时,没进行转义破坏了xml文档结构

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #18192:
URL: https://github.com/apache/echarts/issues/18192#issuecomment-1397046866

   @minren118 It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗
   <details><summary><b>TRANSLATED</b></summary><br>
   
   **TITLE**
   
   [Bug] When using the getDataURL method to get svg text, when there are < symbols, it is not escaped and destroys the xml document structure
   
   **BODY**
   
   ### Version
   
   5.3
   
   ### Link to Minimal Reproduction
   
   _No response_
   
   ### Steps to Reproduce
   
   When using getDataURL to output the svg text of the chart, it is found that ECharts does not escape and re-output special symbols such as <, resulting in an error in the exported svg text.
   When the browser opens, it will show such a logo, and the actual content cannot be rendered.
   ![image](https://user-images.githubusercontent.com/28550438/213464600-0f5799de-85ae-43fc-b29c-b1ec94fa9d41.png)
   
   The actual content is as follows: the XML document structure is broken by <.
   ![image](https://user-images.githubusercontent.com/28550438/213464627-d9046b99-5fef-49c9-8e59-9c8304db4dfa.png)
   
   When escaped, it is normal.
   &lt;text dominant-baseline="central" text-anchor="start" style="font: normal normal 14px Microsoft YaHei" x="30" y="7.5" transform="translate(85 520)" fill="#333">&lt;5</text> 
   ### Current Behavior
   
   The exported string is not escaped.
   
   ### Expected Behavior
   
   If you need to include special characters in the exported string, escape it before output.
   
   ### Environment
   
   ```markdown
   - OS:
   - Browser:
   - Framework:
   ```
   
   ### Any additional comments?
   
   _No response_
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org