We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
最新实现md博客写作平台,需要实现MD格式渲染,这里记录下实现
使用类库:showdownjs
The text was updated successfully, but these errors were encountered:
<script src="https://cdn.bootcss.com/mark.js/8.11.1/mark.min.js"></script>
如果不想CDN引用在CLI配置文件中加入scripts配置也可。
declare let showdown: any; export class AppComponent { constructor() { showdown.setFlavor('github'); showdown.setOption('openLinksInNewWindow', true); } }
declare let showdown: any; export class EditComponent implements OnInit, OnDestroy { renderedCnt: string; sourceCnt: string; converter = new showdown.Converter(); updateView() { this.renderedCnt = this.converter.makeHtml(this.sourceCnt); }
<div class="row"> <div class="col-md-6"> <textarea class="form-control sourceCnt" [(ngModel)]="sourceCnt" (ngModelChange)="updateView()"> </textarea> </div> <div class="col-md-6"> <div id="rendered" [innerHtml]="renderedCnt|safe" class="rendered-post"> </div> </div> </div>
Sorry, something went wrong.
No branches or pull requests
使用类库:showdownjs
The text was updated successfully, but these errors were encountered: