官术网_书友最值得收藏!

Creating a Markdown Editor with TypeScript

It is hard to deal with content on the internet without encountering markdown. Markdown is a simplified way to create content using plain text that is easily converted into simple HTML. In this chapter, we are going to investigate what it takes to create a parser that will convert a subset of the markup format into HTML content. We will automatically convert relevant tags into the first three header levels, the horizontal rule, and paragraphs.

By the end of this chapter, we will have covered how to create a simple Bootstrap web page and reference the JavaScript generated from our TypeScript, as well as hooking up to a simple event handler. We will also cover how to create classes using simple design patterns and how to design classes with single responsibilities, which are techniques that serve us well as professional developers.

The following topics will be covered in this chapter:

  • Creating a Bootstrap page that overrides the Bootstrap styling
  • Choosing which tags we are going to use in our markdown
  • Defining requirements
  • Mapping our markdown tag types to HTML tag types
  • Storing our converted markdown in a custom class
  • Using the visitor pattern to update our document
  • Using the chain-of-responsibility pattern to apply tags
  • Hooking this back to our HTML
主站蜘蛛池模板: 南华县| 青河县| 台中县| 娄底市| 德阳市| 十堰市| 五河县| 阿拉善右旗| 三明市| 永定县| 鸡东县| 宝坻区| 离岛区| 南江县| 保靖县| 湖口县| 佛教| 武定县| 缙云县| 宜良县| 云霄县| 丰都县| 新兴县| 永寿县| 稻城县| 天镇县| 日喀则市| 英山县| 阿荣旗| 镇康县| 太保市| 锦州市| 柘荣县| 囊谦县| 抚顺县| 嘉祥县| 南溪县| 澎湖县| 百色市| 长武县| 马龙县|