How to not escape ampersand in the attribute of an element?
還沒有人認領這個 Issue。
評估
研究方向
從 issue 中展示的 REXML::Text.new 呼叫和元素屬性序列化開始,包括 raw 旗標和元素內容中的行為。追蹤屬性值如何被轉義,並將結果與要求的 Hello�26#10;World 輸出進行比較;當預期的序列化行為獲得確立並由適當的測試涵蓋時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
Hi!
I am trying to create an element with attribute that looks like:
<MyElement
myAttribute = "Hello World">
</MyElement>
which I am doing the the following code:
my_attribute = REXML::Text.new('Hello World')
my_element = REXML::Element.new('MyElement')
my_element.attributes['myAttribute'] = my_attribute
my_element.to_s
and I get Hello&amp;#10;World in the attribute. I also tried using the raw flag for the Text and the { :raw => :all } context for the Element but that removes only a single amp;.
Am I missing something? How can I get to my desired output?
- 主要語言
- Ruby
- 星號
- 181
- 分支
- 105
- 平均合併
- 8 天 16 小時
- 30 天內合併 PR
- 2
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
ruby/rexml 的其他 Issue
-
難度 3/5 1-2 天 新手友好度 55/100
-
XPath underscored function name is wrongly accepted可能已有人在做 @sjh9714 於 49 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 55/100
-
難度 3/5 1-2 天 新手友好度 55/100
-
難度 4/5 3-5 天 新手友好度 48/100
-
難度 5/5 一週以上 新手友好度 35/100
相似的 Issue
-
Feature Feature Parity
難度 2/5 1-3 小時 新手友好度 82/100
valkey-io/valkey-glide-ruby#369 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 74/100
-
難度 2/5 1-3 小時 新手友好度 90/100
維護者通常 3 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
thewca/worldcubeassociation.org#16088 ·
維護者通常 1 天內回覆