Giter VIP home page Giter VIP logo

mark.js's Introduction

mark.js

简介

mark.js可用于标记选中的文字,目前提供的标记类型有文字涂改、文字缺漏、文字删除和文字互换。

结合工具draw可以标记文章中的图片和视频。

预览

校对(PC端/移动端):请狠狠地点这里

自定义插入标签(PC端):请狠狠地点这里

示例

const m = new Mark(document.querySelector('xxx'), {
  tagName: 'mark'
})

// 自动标记
m.automark(dataList)

// 文字涂改、文字缺漏
const data = m.mark('modify')

// 文字删除
const data = m.mark('delete')

// 文字互换
const data = m.mark('exchange', { points })

标记数据

{
  content: string       // 选中文字
  startOffset: number   // 光标起点
  endOffset: number     // 光标结点
  length: number        // 选中文字的长度
  points: number[]      // 选中文字的互换位置
  key: string           // 唯一标识
  type: string          // 标记类型
}

命令行

# 本地运行
yarn serve

# 构建开发环境包
yarn build:dev

# 构建生产环境包
yarn build

# 代码格式检查并自动修复
yarn lint

mark.js's People

Contributors

luoqiling avatar

Stargazers

Roman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.