5

I found the following suggested edit in the review queue:

suggested edit, question

The multi-line code was previously formatted using `…` and it is suggested to be replaced with <code>…</code>. I tried to remove the HTML tags. Since the code block is already indented, I expected it to format as a block code automatically. However, it keeps to render as a plain text. Why does this happen?

formatting issue screenshot

Including 4 more spaces like in Code formatting is not working does not help.

0

1 Answer 1

13

The code was pasted with U+2028 LINE SEPARATOR characters:

public View getView(final int position, View view, ViewGroup parent) {\u2028
    final ViewHolder holder;\u2028\u2028\u2028
        if (view == null) {\u2028\u2028holder = new ViewHolder();\u2028
            view = inflater.inflate(R.layout.layout_homelistrow, null);\u2028
            holder.list_text = (TextView) view.findViewById(R.id.list_text);\u2028
            holder.checkBox = (CheckBox) view.findViewById(R.id.check_change);\u2028\u2028
            holder.button = (Button) view.findViewById(R.id.change_button);\u2028
            holder.flag = (ImageView) view.findViewById(R.id.list_image);\u2028
            //holder.Text_header=(TextView)view.findViewById(R.id.list_text);\u2028
            view.setTag(holder);\u2028\u2028} else {\u2028
            holder = (ViewHolder) view.getTag();\u2028
        }\u2028
    }

When you remove those the block is rendered correctly.

4
  • @Melebius: I've re-edited based of the source of the first revision, replacing each U+2028 character with a \n newline.
    – Martijn Pieters Mod
    Commented Jan 25, 2017 at 13:22
  • 1
    Is it possible to show these "non-normal" characters in the editor? Or do we have to copy the contents elsewhere to find out? Commented Jan 26, 2017 at 9:31
  • 1
    @TheLethalCoder: the editor is not equipped to alter the display of every single weird Unicode character. I did figure out what was going on by bisection (removing half of the text until the problem went away), but I did then have to use the source text and Python to turn non-ASCII characters into escape sequences to arrive at the final conclusion.
    – Martijn Pieters Mod
    Commented Jan 26, 2017 at 9:35
  • Feature Request: Show "weird" Unicode characters as escape sequences... only semi-serious Commented Jan 26, 2017 at 14:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .