Before:
# Headline\n

After:
\n
# Headline\n
\n
192334
private function wrapHeadlinesWithEmptyLines(string $content): string
    {
        return Strings::replace($content, self::HEADLINE_PATTERN, function (array $match) {
            return PHP_EOL . $match['headline'] . PHP_EOL;
        });
    }
383981
public function heading($text) {
        $this->info('');
        $this->info('===================');
        $this->info($text);
        $this->info('===================');
        $this->info('');
    }
1195746
def pre(*content, sep='\n'):
    
    return _md(_join(*content, sep=sep), symbols=MD_SYMBOLS[3])
786304
function formErrorText (info, msg) {
  const hr = '----------'

  return addPlatformInformation(info)
  .then((obj) => {
    const formatted = []

    function add (msg) {
      formatted.push(
        stripIndents(msg)
      )
    }

    add(`
      ${obj.description}

      ${obj.solution}

    `)

    if (msg) {
      add(`
        ${hr}

        ${msg}

      `)
    }

    add(`
      ${hr}

      ${obj.platform}
    `)

    if (obj.footer) {
      add(`

        ${hr}

        ${obj.footer}
      `)
    }

    return formatted.join('\n\n')
  })
}
666221
function mentionsPredicate(str) {
  // null/empty check
  if (!str) {
    return false;
  // has @ symbol
  } else if (str.indexOf('@') < 0) {
    return false;
  // has @ symbol as first char
  } else if (str[0] !== '@') {
    return false;
  // contains non-word chars
  } else if ((/[^\w\s]/).test(str.slice(1))) {
    return false;
  // if ends with @
  } else if (str[str.length - 1] === '@') {
    return false;
  }
  return true;
}
1277474
def text(self):
        
        parts = [("%s" if isinstance(p, Insert) else p) for p in self.parts]
        parts = [("%%" if p == "%" else p) for p in parts] # escape percent
        return "".join(parts)
1019710
function pre(tmpl) {
  // Iterate over the beforeFns
  var i = 0,
      len = beforeFns.length;
  for (; i < len; i++) {
    tmpl = beforeFns[i].call(this, tmpl) || tmpl;
  }

  // Return tmpl
  return tmpl;
}
998928
def prettify(text)
      pretty = abbreviate(text) { |short| short.sub!(/[[:punct:]]+\z/, '') }
      sanitize pretty
    end
547537
def _render_before(self, element):
        ''''''
        start = ["%s<%s" % (self.spaces, element.tag)]
        if element.id:
            start.append(" id=%s" % self.element.attr_wrap(self.replace_inline_variables(element.id)))
        if element.classes:
            start.append(" class=%s" % self.element.attr_wrap(self.replace_inline_variables(element.classes)))
        if element.attributes:
            start.append(' ' + self.replace_inline_variables(element.attributes))

        content = self._render_inline_content(self.element.inline_content)

        if element.nuke_inner_whitespace and content:
            content = content.strip()

        if element.self_close and not content:
            start.append(" />")
        elif content:
            start.append(">%s" % (content))
        elif self.children:
            start.append(">%s" % (self.render_newlines()))
        else:
            start.append(">")
        return ''.join(start)
151517
function prep (id) {
    id = id.replace(/(?:%20|\+)/g, ' ')
    id = self.headingAutoId({ text: id })
    return id
  }
566882
function (header, body) {
                var result = "";
                if (body !== "") {
                   result += chalk.red.bold(header) + ":\n";
                   result += chalk.red(body.replace(/\r?\n/, "").replace(/^/mg, "| ")) + "\n";
                }
                return result;
            }
959012
def to_s
      text = "#{keyword} #{self.text}"
      text << "\n" + block.to_s.split("\n").collect { |line| "  #{line}" }.join("\n") if block

      text
    end
943416
def text(self):
        """"""
        texts = []
        for child in self.childs:
            if isinstance(child, Tag):
                texts.append(child.text())
            elif isinstance(child, Content):
                texts.append(child.render())
            else:
                texts.append(child)
        return " ".join(texts)
1133351
def display_heading(text, level, indent)
      text = strip_attributes(text)
      case level
      when 1
        puts "= " + text.upcase
      when 2
        puts "-- " + text
      else
        print indent, text, "\n"
      end
    end
734815
@Override
    public String dialogBlockStart(String headline) {

        StringBuffer result = new StringBuffer(8);
        result.append("<tr><td colspan=\"5\">\n");
        result.append(super.dialogBlockStart(headline));
        return result.toString();
    }
986156
def before_show
      @flags[:title] = @flags[:title] ? @flags[:title] : @flags[:headline]
      @builder[:window1].title = @flags[:title] if @flags[:title]
      @builder[:window1].resize(@flags[:width],100) if @flags[:width].to_i > 100
      @builder[:headline].show if @flags[:headline]
    
      if @flags[:input_text]
        @flags[:button_yes] ||= "Save"
        @flags[:button_no] ||= "Cancel"
        @builder[:input_text].show
      elsif choices = @flags[:choices]
        @flags[:button_yes] ||= "Select"
        @flags[:button_no] ||= "Cancel"
        choices.each { |c| @builder[:choices_text].append_text(c) }
        @choices_text = choices[0]
        @builder[:choices_text].show 
      end 

      @builder[:button_no].show if @flags[:button_no]
      @builder[:button_cancel].show if @flags[:button_cancel]
      set_glade_hash(@flags)
    end
720475
function BlockStatement(node, print) {
  this.push("{");
  if (node.body.length) {
    this.newline();
    print.sequence(node.body, { indent: true });
    if (!this.format.retainLines) this.removeLast("\n");
    this.rightBrace();
  } else {
    print.printInnerComments();
    this.push("}");
  }
}