kartik-v / yii2-markdown

Advanced Markdown editing and conversion utilities for Yii Framework 2.0
http://demos.krajee.com/markdown
Other
89 stars 41 forks source link

Making Markdown class configurable (see #17) #18

Open drenty opened 10 years ago

drenty commented 10 years ago

See #17

My suggestion to make Markdown class extendable and configurable so we can override beforeProcess and afterProcess.

Not ready to merge (no doc). RFC only.

Can be configured like this:

'modules' => [
    'markdown' => [
        'class' => 'kartik\markdown\Module',
        'previewAction' => '/markdown/parse/preview',
        'smartyPants' => true,
        'components' => [
            'parser' => [
                'class' => 'kartik\markdown\Markdown'
            ]
        ]
    ]
]
drenty commented 10 years ago

Great! I think this structure will be helpful with cebe's parser too.

drenty commented 10 years ago

Hello Kartik,

Do you plan on implementing cebe/markdown?

Do you need a hand?

kartik-v commented 10 years ago

I am waiting for MarkdownExtra to be fully supported in cebe's parser.

However, it sure would be good if you could lend a hand. One way to do it could be to make this class in a way, where we could configure to use michelf/MarkdownExtra and michelf/SmartyPants based on a property.... and for the rest use cebe's parser.

drenty commented 10 years ago

Ok, I'll see what I can do.