Mini Markdown

January 21, 2020

Today’s exercise is an interview question. The situation is an interviewee at home, sharing his screen with an interviewer at his office. The interviewee has one hour to write the following program while the interviewer watches:

Write a program that takes a text file as input and writes an html file as output. The input consists of one or more paragraphs (maximal lines of text separated by blank lines). The following elements of John Gruber’s Markdown language are supported:

– ###### up to six levels of headings

– unordered lists introduce by a dash (like this paragraph)

– plain text paragraphs

Your task is to write a mini-Markdown processor; you have one hour to complete it. When you are finished, you are welcome to read or run a suggested solution, or to post your own solution or discuss the exercise in the comments below.

Pages: 1 2