mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-07 21:42:25 +00:00
Extension for bootstrap alert #152
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @stanac on GitHub (Nov 7, 2017).
Is it possible to extend bootstrap extension to support alerts?
Currently if we want to add alert in a document, we need to write html div tag with appropriate class.
It would be nice to have something like
this converted to this
Syntax can be different, I am not too familiar with markdown specification, so I am not sure if this approach would be ok or not.
@xoofx commented on GitHub (Nov 7, 2017):
Yes, I guess it should be feasible.
@xoofx commented on GitHub (Nov 7, 2017):
It would likely use the existing custom container extension
@stanac commented on GitHub (Nov 7, 2017):
That looks interesting, I will check if it can be used out of the box, and if not how much effort would it be to implement it.
@xoofx commented on GitHub (Nov 7, 2017):
Not sure it will work out of the box (until css supports alias like
danger=>alert alert-danger)Otherwise it should be a very small change to the bootstrap extension to process CustomContainerBlock and change the class according to bootstrap classes
@stanac commented on GitHub (Nov 7, 2017):
I was thinking about more generic solution. Instead of creating CSS alias
danger=>alert alert-danger, maybe it would be better to add support for multiple CSS classes, e.g.This source:
would translate to:
@xoofx please let me know if you find this feature to be acceptable?
@cyotek commented on GitHub (Apr 14, 2018):
@stanac I was just searching for similar functionality and I came across this issue, but also this cheatsheet. The example given in the cheatsheet was
I tested this in some of my own content and it appears to be working absolutely fine with base Markdig and no third party extensions. The braces appear to be the key as when I originally tried using custom containers the content after the space was lost.
Clearly it's not quite as friendly as a simple "danger" label, but it does seem to get the job done - not sure if that's of any help to you or not.
@stanac commented on GitHub (Apr 15, 2018):
@cyotek thanks for the find. I've bookmarked the cheatsheet. It's a generic solution I was looking for, so I'm closing the issue (@xoofx please reopen it if you disagree). @xoofx it would be nice to have a cheatsheet (this one or another similar) linked in the readme.