Library doesn’t recognise {color:} as valid empty colour tag
Issue #58
resolved
Request {color:}aaa{color}bbb{color}ccc{color}
Typescript
{
"version": 1,
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "aaa",
"marks": [
{
"type": "textColor",
"attrs": {
"color": "#000000"
}
}
]
},
{
"type": "text",
"text": "bbb"
},
{
"type": "text",
"text": "ccc",
"marks": [
{
"type": "textColor",
"attrs": {
"color": "#000000"
}
}
]
}
]
}
]
}
adf-builder-java
{
"type" : "doc",
"version" : 1,
"content" : [ {
"type" : "paragraph",
"content" : [ {
"type" : "text",
"text" : "{color:}aaa"
}, {
"type" : "text",
"text" : "bbb",
"marks" : [ {
"type" : "textColor",
"attrs" : {
"color" : "#000000"
}
} ]
}, {
"type" : "text",
"text" : "ccc"
} ]
} ]
}
Comments (4)
-
-
reporter -
assigned issue to
-
assigned issue to
-
reporter - changed status to open
-
reporter - changed status to resolved
- Log in to comment
Interestingly, what the content service is doing there is wrong. The wiki renderer is doing this:
Wiki
HTML
The result of the empty color tag is for it to have no effect at all. However the content service’s transformer is producing a
textColor
mark with color#000000
, which forces the color to black even when that isn’t what would otherwise be inherited. Since ADF is not permitted to use atextColor
mark without it specifying a color value, the most correct thing we could do is simply discard the emptycolor
macro and leave thetext
node unmarked.Of course, like so many other discrepancies, we may want to mimic FCS’s current wrong behaviour while we still care about consistency checking.