showdownjs / ng-showdown

Angular integration for Showdown
BSD 3-Clause "New" or "Revised" License
105 stars 33 forks source link

Addin setFlavor function #21

Open SyntaxRules opened 8 years ago

SyntaxRules commented 8 years ago

Add in set flavor function into the $showdownProvider. This would be a new option.

collaborator99 commented 8 years ago

+1 I wound up doing the following:

var github = { //  the github object was taken from flavor.github in showdown.js
    omitExtraWLInCodeBlocks: true,
    prefixHeaderId: 'user-content-',
    simplifiedAutoLink: true,
    literalMidWordUnderscores: true,
    strikethrough: true,
    tables: true,
    tablesHeaderId: true,
    ghCodeBlocks: true,
    tasklists: true
};
for (var key in github) {
    $showdown.setOption(key, github[key]);
}

Any suggestions on a simpler way?