Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Support text highlights with <mark>

未关闭
#210 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
go, markdown
领域
cli

调研方向

Start by tracing the read, publish, update, and check entry points that handle Markdown and Confluence formatting. Compare the existing span and mark handling, then verify that highlighted text survives a read → edit → update cycle and that the supported mark syntax is reported consistently by check.

由索引模型根据 Issue 内容生成。

描述

enhancement

Problem

  • read drops highlights. Confluence's editor can give a run of text a background colour. It is stored as <span style="background-color: rgb(…)"> and becomes an ADF backgroundColor mark. read writes only the text, so a read → edit → update cycle removes every highlight from the page. (Verified 2026-09-26 on a scratch page.)
  • There is no way to write a highlight in Markdown. ==text== is not GFM and stays literal. A raw <mark> passes through, but Confluence drops the tag and keeps only the text. Only a raw <span style="background-color: …"> works, and nobody would guess that.

What Confluence did with each spelling (storage read back, then ADF):

written stored takes effect (ADF)
<span style="background-color: #fff0b3;"> kept, rewritten as rgb(255,240,179) yes, backgroundColor
the same in rgb() kept yes
<mark> tag dropped, text kept no
<span data-highlight-colour="…"> (the table-cell attribute) attribute dropped no
<span style="color: …"> (text colour, for comparison) kept yes, textColor

Proposal

Use <mark>, which GitHub renders:

Markdown published as
<mark>some text</mark> <span style="background-color: #fff0b3;">some text</span> (a default colour)
<mark style="background-color: #ffbbbb;">some text</mark> <span style="background-color: #ffbbbb;">some text</span>

read writes a highlighted span back as <mark> (the default colour) or <mark style="background-color: …"> (any other colour), so the page survives a round trip. Markdown inside a <mark> is still converted.

The attribute is background-color, not color, because in CSS color is the text colour.

Open questions

  1. Default colour. #fff0b3 is the table-cell palette's yellow. The editor's text-highlight palette may differ; read back a highlight made in the editor to find out.
  2. Names or only hex? Cell colours accept swatch names. A name is not valid in a CSS background-color, so either hex only, or names in another attribute.
  3. An unrecognised colour. Publish with a warning, as an unknown cell colour does, and have check report it?
  4. Text colour. read probably drops <span style="color: …"> the same way. Handle it here, or in a separate issue?
主要语言
Go
星标
2
派生
0
平均合并
2 小时 31 分钟
30 天内合并 PR
59

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

mozilla/markfluence 的其他 Issue

查看 mozilla/markfluence 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。