Good day to all! There is such a task. There is some markup syntax defining tables. The syntax is very simple, it uses two characters (the # character to define the header cells of the table and the | character to restrict normal cells) and the line feed character (indicating the end of the table line). I will show by example:
# заголовок1 # заголовок2 # заголовок 3 # | ячейка1 стр1| ячейка2 стр1| ячейка3 стр1| | ячейка1 стр2| ячейка2 стр2| ячейка3 стр2| This simple construction must be parsed into this html-size:
<table> <tr> <th>заголовок1</th> <th>заголовок2</th> <th>заголовок3</th> </tr> <tr> <td>ячейка1 стр1</td> <td>ячейка3 стр1</td> <td>ячейка4 стр1</td> </tr> <tr> <td>ячейка1 стр2</td> <td>ячейка3 стр2</td> <td>ячейка4 стр2</td> </tr> </table> I am not good at such things, so I would like to ask knowledgeable people how this can be done and where to dig at all? Unfortunately, using third-party libraries is impossible (these are the conditions of the problem). What algorithms and tools can be applied here? I would also like to clarify that the texts themselves with this markup can be quite voluminous, so productivity is also important. Thank you in advance!
|? - Grundy