Replies: 2 comments
-
|
As you know, code blocks consist of pre and code tags. Because of this, it is impossible to determine which tag should receive attributes, so |
Beta Was this translation helpful? Give feedback.
-
|
Hello, I think it can be solved by changing a few things to the SetAttribute(name []byte, value interface{}, tags ...string)
SetAttributeString(name string, value interface{}, tags ...string)
Attribute(name []byte) (interface{}, bool), tags ...string
AttributeString(name string) (interface{}, bool, tags ...string)So the
func RenderAttributes(w util.BufWriter, node ast.Node, filter util.BytesFilter, tag ...string) {
Probably type Attribute struct {
Name []byte
Value interface{}
Tag string
}(note The chosen Of course, changing a public interface and a public struct is a breaking change, but it is a small change with a very low impact as if tags are never used, nothing change in foreign code as the variadic The following
What do you think? If you are interested, I can provide a POC. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
Is there any reason why html.renderCodeBlock and html.renderFencedCodeBlock do not allow to RenderAttributes as other HTML tags?
If not and a fix is accepted, how to distinguish the attributes targeting
<pre>from those targetting<code>?Beta Was this translation helpful? Give feedback.
All reactions