Repository: Avaiga/taipy
File: taipy/gui/_renderers/_markdown/preproc.py (Python)

Code before:
                continue
            new_line = ""
            last_index = 0
            # Opening tags
            m = _Preprocessor.__OPENING_TAG_RE.search(line)
            if m is not None:
                tag = "part"
                properties: List[Tuple[str, str]] = []
                if m.group(2):
                    tag, properties = self._process_control(m.group(2), line_count, tag)
                if tag in _MarkdownFactory._TAIPY_BLOCK_TAGS:
                    tag_stack.append((tag, line_count, m.group(1) or None))
                    new_line_delimeter = "\n" if line.startswith("<|") else "\n\n"
                    line = (
                        line[: m.start()]
                        + new_line_delimeter
                        + _MarkdownFactory._TAIPY_START
                        + tag
                        + _MarkdownFactory._START_SUFFIX
                    )
                    for property in properties:
                        prop_value = property[1].replace('"', '\\"')
                        line += f' {property[0]}="{prop_value}"'
                    line += _MarkdownFactory._TAIPY_END + new_line_delimeter
                else:
                    _warn(f"Failed to recognized block tag '{tag}' in line {line_count}. Verify that you are closing the tag properly with '|>' if it is a control element.")  # noqa: E501
            # Other controls
            for m in _Preprocessor.__CONTROL_RE.finditer(line):
                control_name, properties = self._process_control(m.group(1), line_count)
                new_line += line[last_index : m.start()]
                control_text = _MarkdownFactory._TAIPY_START + control_name
                for property in properties:
                    prop_value = property[1].replace('"', '\\"')
                    control_text += f' {property[0]}="{prop_value}"'
                control_text += _MarkdownFactory._TAIPY_END
                new_line += control_text
                last_index = m.end()
            new_line = line if last_index == 0 else new_line + line[last_index:]
            # Add key attribute to links
            line = new_line
            new_line = ""
            last_index = 0
            for m in _Preprocessor.__LINK_RE.finditer(line):
                new_line += line[last_index : m.end()]
                new_line += "{: key=" + _Builder._get_key("link") + "}"
                last_index = m.end()
            new_line = line if last_index == 0 else new_line + line[last_index:]
            # Look for a closing tag
            m = _Preprocessor.__CLOSING_TAG_RE.search(new_line)
            if m is not None:
                if len(tag_stack):

Review comment (bug):
```suggestion
                    _warn(f"Failed to recognized block tag '{tag}' in line {line_count}. Check that you are closing the tag properly with '|>' if it is a control element.")  # noqa: E501
```

Code after:
                continue
            new_line = ""
            last_index = 0
            # Opening tags
            m = _Preprocessor.__OPENING_TAG_RE.search(line)
            if m is not None:
                tag = "part"
                properties: List[Tuple[str, str]] = []
                if m.group(2):
                    tag, properties = self._process_control(m.group(2), line_count, tag)
                if tag in _MarkdownFactory._TAIPY_BLOCK_TAGS:
                    tag_stack.append((tag, line_count, m.group(1) or None))
                    new_line_delimeter = "\n" if line.startswith("<|") else "\n\n"
                    line = (
                        line[: m.start()]
                        + new_line_delimeter
                        + _MarkdownFactory._TAIPY_START
                        + tag
                        + _MarkdownFactory._START_SUFFIX
                    )
                    for property in properties:
                        prop_value = property[1].replace('"', '\\"')
                        line += f' {property[0]}="{prop_value}"'
                    line += _MarkdownFactory._TAIPY_END + new_line_delimeter
                else:
                    _warn(f"Failed to recognized block tag '{tag}' in line {line_count}. Check that you are closing the tag properly with '|>' if it is a control element.")  # noqa: E501
            # Other controls
            for m in _Preprocessor.__CONTROL_RE.finditer(line):
                control_name, properties = self._process_control(m.group(1), line_count)
                new_line += line[last_index : m.start()]
                control_text = _MarkdownFactory._TAIPY_START + control_name
                for property in properties:
                    prop_value = property[1].replace('"', '\\"')
                    control_text += f' {property[0]}="{prop_value}"'
                control_text += _MarkdownFactory._TAIPY_END
                new_line += control_text
                last_index = m.end()
            new_line = line if last_index == 0 else new_line + line[last_index:]
            # Add key attribute to links
            line = new_line
            new_line = ""
            last_index = 0
            for m in _Preprocessor.__LINK_RE.finditer(line):
                new_line += line[last_index : m.end()]
                new_line += "{: key=" + _Builder._get_key("link") + "}"
                last_index = m.end()
            new_line = line if last_index == 0 else new_line + line[last_index:]
            # Look for a closing tag
            m = _Preprocessor.__CLOSING_TAG_RE.search(new_line)
            if m is not None:
                if len(tag_stack):