   end
 
   defp do_fix_line_syntax {line, no}, :fix_do_opts do
-    line1 = ~R/((?:^ *| +)\| +[\w\.\-]+[^\|]*) +do: +(\| +.+)/u
+    line1 = ~R/((?:^ *|\s+)\|\s+[\w\.\-]+[^\|]*) +do: +(\|\s+.+)/u
       |> Regex.replace(line, "\\1 do \\2 | end")
 
-    line2 = ~R/(^ *| +)\| +([\w\.\-]+)( +[^\|]*?)do(?= *$| +\| +[\w\.\-]+)/u
-      |> Regex.replace(line1, "\\1| do.\\2\\3")
+    line2 = ~R/(\s*\|\s+)([\w\.\-]+)(\s+[^\|]*?)do(?=\s*$|\s+\|\s+[\w\.\-]+)/u
+      |> Regex.replace(line1, "\\1do.\\2\\3")
     {line2, no}
   end
 
   defp do_fix_line_syntax {line, no}, :fix_question_mark do
-    line2 = ~R/(^ *)\| +([\w\.\-]+)\? *?(.*?)([\w\.\-:]+: +.+?)?(?=(\s+\| +[\w\.\-]+.*)|\s*$)\5?/u
+    line2 = ~R/(^ *)\|\s+([\w\.\-]+)\? *?(.*?)([\w\.\-:]+: +.+?)?(?=(\s+\|\s+[\w\.\-]+.*)|\s*$)\5?/u
       |> Regex.replace(line, fn
         _, _1, _2, "", _4, "" -> ""
         _, f1, f2, "", _4, f5 -> "#{f1}| unless do #{f2}#{f5} | end"

  end

  defp do_fix_line_syntax {line, no}, :fix_noset_value do
    line2 = ~R/(\s*\|\s+)([0-9]|[^\w\s])(.*?)(?=\s+\| +|\s*$)/u
      |> Regex.replace(line, "\\1set \\2\\3")
    {line2, no} 
  end

  end

  defp extract_pipes state do
    res = ~R/(?:^|\s)\|\s+(\S+)([\s\S]*?),?(\s+[\w\.\-:]+: +[\s\S]+?)?(?=\s+\|\s+\S+|\s*$)/u
      |> Regex.scan(state.cdata)
      |> Enum.map(fn list ->
        args = (Enum.at(list, 2) || "") 
