Skip to content

BlockQuotes

MeanderingProgrammer edited this page Aug 4, 2024 · 2 revisions

Block Quotes

Raw data being used:

# Normal Quote

> A modest length quote
> Split over
> Multiple lines

# Really Long Quote

> Just a long line
> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut eleifend metus. Proin velit dui, suscipit in viverra eu, scelerisque dictum elit.

Default

require('render-markdown').setup({
    quote = {
        enabled = true,
        icon = '',
        repeat_linebreak = false,
        highlight = 'RenderMarkdownQuote',
    },
})

Custom Icon

require('render-markdown').setup({
    quote = { icon = '' },
})

Repeat Line Break (naive)

require('render-markdown').setup({
    quote = { repeat_linebreak = true },
})

Repeat Line Break (working)

In the previous example you can see that while the line break has the quote marker the actual text is being cut off. This is due to all the settings that impact line break behavior. Rather than validating these we provide an example that works using the win_options field. There are many more ways to accomplish this.

require('render-markdown').setup({
    quote = { repeat_linebreak = true },
    win_options = {
        showbreak = { default = '', rendered = '  ' },
        breakindent = { default = false, rendered = true },
        breakindentopt = { default = '', rendered = '' },
    },
})
Clone this wiki locally