You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Details
Request: #401
Allows `paragraph.left_margin` option to be a function that returns a
number based on the context in addition to a flat number. The context
provided currently is just the text value of the node, but can be
expanded in the future if needed.
This can be used to set a different margin based on the length of the
paragraph. For example use a margin of 4 for paragraphs longer than 80
characters, otherwise use no margin:
```lua
require('render-markdown').setup({
paragraph = {
left_margin = function(ctx)
return #ctx.text > 80 and 4 or 0
end,
},
})
```
0 commit comments