quill icon indicating copy to clipboard operation
quill copied to clipboard

How to customize the row height in quill 2.0.0-dev3

Open shadow-dust opened this issue 3 years ago • 1 comments
trafficstars

I read quill's source code and wrote the line height according to the writing method of size.js, but it doesn't take effect. How can I customize the line height in 2.0.0-dev3

const lineHeightClass = new ClassAttributor('lineheight', 'ql-lineheight', {
  scope: Scope.INLINE,
  whitelist: ['1.0', '1.2', '1.5', '1.6', '1.8', '2.0', '2.4', '2.8', '3.0', '4.0', '5.0']
})
const lineHeightStyle = new StyleAttributor('lineheight', 'line-height', {
  scope: Scope.INLINE,
  whitelist: ['1.0', '1.2', '1.5', '1.6', '1.8', '2.0', '2.4', '2.8', '3.0', '4.0', '5.0']
})
Quill.register(
  {
    'attributors/class/lineHeight': lineHeightClass,
    'attributors/style/lineHeight': lineHeightStyle
  },
  true
)
Quill.register({ 'formats/lineHeight': lineHeightClass }, true)

shadow-dust avatar Aug 05 '22 01:08 shadow-dust

maybe you can try register the lineHeightStyle depond on the select tag;

TonyYu2015 avatar Sep 05 '22 08:09 TonyYu2015

Quill 2.0 has been released (announcement post) with many changes and fixes. If this is still an issue please create a new issue after reviewing our updated Contributing guide :pray:

quill-bot avatar Apr 17 '24 10:04 quill-bot