Waylan Limberg avatar Waylan Limberg committed 8f42007

Fixed ticket 32. When raw html starts a line, the raw html is only broken into a seperate block if it is a block tag. Inline tags are left in the block for the inline pattern as they should be.

Comments (0)

Files changed (1)

markdown/preprocessors.py

                     left_tag = self._get_left_tag(block)
                     right_tag, data_index = self._get_right_tag(left_tag, block)
 
-                    if data_index < len(block):
+                    if block[1] == "!":
+                        # is a comment block
+                        left_tag = "--"
+                        right_tag, data_index = self._get_right_tag(left_tag, block)
+                        # keep checking conditions below and maybe just append
+                    
+                    if data_index < len(block) \
+                        and markdown.isBlockLevel(left_tag): 
                         text.insert(0, block[data_index:])
                         block = block[:data_index]
 
                         new_blocks.append(block.strip())
                         continue
 
-                    if block[1] == "!":
-                        # is a comment block
-                        left_tag = "--"
-                        right_tag, data_index = self._get_right_tag(left_tag, block)
-                        # keep checking conditions below and maybe just append
-
                     if block.rstrip().endswith(">") \
                         and self._equal_tags(left_tag, right_tag):
                         new_blocks.append(
                         # if is block level tag and is not complete
 
                         if markdown.isBlockLevel(left_tag) or left_tag == "--" \
-                        and not block.rstrip().endswith(">"):
+                            and not block.rstrip().endswith(">"):
                             items.append(block.strip())
                             in_tag = True
                         else:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.