【问题标题】:How to implement text highlighting in epub react reader?如何在 epub react reader 中实现文本突出显示?
【发布时间】:2021-05-03 04:07:45
【问题描述】:

我使用this 实现了反应阅读器。然后我使用this example实现了突出显示文本。但是我遇到了以下错误: 类型错误:contents.mark 不是函数

谁能帮我解决?

【问题讨论】:

    标签: reactjs epub react-functional-component epub.js


    【解决方案1】:

    看起来那个例子已经过时了。您最好查看“亮点”示例。

    mark() 函数实际上存在于annotations 对象上,它是rendition 的一部分,而不是contentmarkhighlightunderline 本质上都是一样的,只是样式有点不同。

    您应该可以拨打rendition.annotations.mark(cfiRange)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-16
      • 1970-01-01
      • 2017-08-05
      • 1970-01-01
      • 2018-01-26
      • 1970-01-01
      相关资源
      最近更新 更多