Merge remote-tracking branch 'n-peugnet/display-inline-code'
This commit is contained in:
commit
a8660c7137
@ -8,6 +8,8 @@
|
||||
(thanks to [@3nprob] in [#328]).
|
||||
* Added support for shortcodes *without* tab-completion in `/react`
|
||||
(thanks to [@tleb] in [#354]).
|
||||
* Added background color to differentiate `inline code`
|
||||
(thanks to [@n-peugnet] in [#361]).
|
||||
* Added tab-completion support for `/toggle` options
|
||||
(thanks to [@n-peugnet] in [#362]).
|
||||
* Added initial support for rendering spoilers in messages.
|
||||
@ -24,6 +26,7 @@
|
||||
[@n-peugnet]: https://github.com/n-peugnet
|
||||
[#328]: https://github.com/tulir/gomuks/pull/328
|
||||
[#354]: https://github.com/tulir/gomuks/pull/354
|
||||
[#361]: https://github.com/tulir/gomuks/pull/361
|
||||
[#362]: https://github.com/tulir/gomuks/pull/362
|
||||
|
||||
# v0.2.4 (2021-09-21)
|
||||
|
@ -139,6 +139,11 @@ func (parser *htmlParser) basicFormatToEntity(node *html.Node) Entity {
|
||||
entity.AdjustStyle(AdjustStyleStrikethrough, AdjustStyleReasonNormal)
|
||||
case "u", "ins":
|
||||
entity.AdjustStyle(AdjustStyleUnderline, AdjustStyleReasonNormal)
|
||||
case "code":
|
||||
bgColor := tcell.ColorDarkSlateGray
|
||||
fgColor := tcell.ColorWhite
|
||||
entity.AdjustStyle(AdjustStyleBackgroundColor(bgColor), AdjustStyleReasonNormal)
|
||||
entity.AdjustStyle(AdjustStyleTextColor(fgColor), AdjustStyleReasonNormal)
|
||||
case "font", "span":
|
||||
fgColor, ok := parser.parseColor(node, "data-mx-color", "color")
|
||||
if ok {
|
||||
@ -357,7 +362,7 @@ func (parser *htmlParser) tagNodeToEntity(node *html.Node) Entity {
|
||||
return parser.headerToEntity(node)
|
||||
case "br":
|
||||
return NewBreakEntity()
|
||||
case "b", "strong", "i", "em", "s", "strike", "del", "u", "ins", "font", "span":
|
||||
case "b", "strong", "i", "em", "s", "strike", "del", "u", "ins", "font", "span", "code":
|
||||
return parser.basicFormatToEntity(node)
|
||||
case "a":
|
||||
return parser.linkToEntity(node)
|
||||
|
Loading…
Reference in New Issue
Block a user