quill
quill copied to clipboard
How to customize the row height in quill 2.0.0-dev3
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)
maybe you can try register the lineHeightStyle depond on the select tag;
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: