Samsara Interview Question

Write a parser that converts a text to HTML code depending on the flags at the beginning of each line.