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

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
主站蜘蛛池模板: 石景山区| 吉木乃县| 运城市| 遂溪县| 鹿邑县| 根河市| 阿克苏市| 咸阳市| 东平县| 南郑县| 阳春市| 林芝县| 丰顺县| 金沙县| 新巴尔虎右旗| 大同县| 四会市| 富民县| 梅河口市| 安阳市| 遵义市| 阿拉尔市| 江孜县| 合阳县| 容城县| 二连浩特市| 南漳县| 马尔康县| 平舆县| 漯河市| 胶南市| 乌兰浩特市| 河津市| 淳化县| 德化县| 彭水| 沧源| 岳阳县| 太原市| 宁远县| 西青区|