Repository: JuliaLang/julia
File: stdlib/Markdown/src/Common/block.jl (Julia)

Code before:
            elseif occursin(r"^ {0,3}\d+(\.|\))( |$)", bullet)
                # An ordered list. Either with `1. ` or `1) ` style numbering.
                r = occursin(".", bullet) ? r"^ {0,3}(\d+)\.( |$)" : r"^ {0,3}(\d+)\)( |$)"
                Base.parse(Int, (match(r, bullet)::AbstractMatch).captures[1]), r
            else
                # Failed to match any bullets. This branch shouldn't actually be needed
                # since the `NUM_OR_BULLETS` regex should cover this, but we include it
                # simply for thoroughness.
                return false
            end

        # Initialise the empty list object: either ordered or unordered.
        list = List(initial)

        buffer = IOBuffer() # For capturing nested text for recursive parsing.
        newline = false     # For checking if we have two consecutive newlines: end of list.
        count = 0           # Count of list items. Used to check if we need to push remaining
                            # content in `buffer` after leaving the `while` loop.
        while !eof(stream)
            if startswith(stream, "\n")
                if newline
                    # We have a double newline. Peek ahead to see if the next non-blank
                    # line is indented. If so, continue the list item.
                    saved_pos = position(stream)

                    #Skip any additional blank lines and check indntation
                    still_indented = false
                    while !eof(stream)
                        if startswith(stream, "\n")
                            continue
                        elseif startswith(stream, " "^indent)
                            still_indented = true
                            break
                        else
                            break
                        end
                    end
                    #Reset stream to position after the double newline we detected
                    seek(stream, saved_pos)
                    if still_indented
                        #Multiple blank lines within indented content - allow it
                        println(buffer)
                    else
                        # Double newline ends the current list
                        pushitem!(list, buffer)
                        break
                    end
                else
                    newline = true
                    println(buffer)
                end

Review comment (suggestion):
Please put a space after `#` to follow the style of the surrounding code. Also: typo :-)
```suggestion
                    # Skip any additional blank lines and check indentation
```

Code after:
            elseif occursin(r"^ {0,3}\d+(\.|\))( |$)", bullet)
                # An ordered list. Either with `1. ` or `1) ` style numbering.
                r = occursin(".", bullet) ? r"^ {0,3}(\d+)\.( |$)" : r"^ {0,3}(\d+)\)( |$)"
                Base.parse(Int, (match(r, bullet)::AbstractMatch).captures[1]), r
            else
                # Failed to match any bullets. This branch shouldn't actually be needed
                # since the `NUM_OR_BULLETS` regex should cover this, but we include it
                # simply for thoroughness.
                return false
            end

        # Initialise the empty list object: either ordered or unordered.
        list = List(initial)

        buffer = IOBuffer() # For capturing nested text for recursive parsing.
        newline = false     # For checking if we have two consecutive newlines: end of list.
        count = 0           # Count of list items. Used to check if we need to push remaining
                            # content in `buffer` after leaving the `while` loop.
        while !eof(stream)
            if startswith(stream, "\n")
                if newline
                    # We have a double newline. Peek ahead to see if the next non-blank
                    # line is indented. If so, continue the list item.
                    saved_pos = position(stream)

                    # Skip any additional blank lines and check indentation
                    still_indented = false
                    while !eof(stream)
                        if startswith(stream, "\n";eat = true)
                            continue
                        elseif startswith(stream, " "^indent; eat = false)
                            still_indented = true
                            break
                        else
                            break
                        end
                    end
                    # Reset stream to position after the double newline we detected
                    seek(stream, saved_pos)
                    if still_indented
                        # Multiple blank lines within indented content - allow it
                        println(buffer)
                    else
                        # Double newline ends the current list
                        pushitem!(list, buffer)
                        break
                    end
                else
                    newline = true
                    println(buffer)
                end