Check out Grant Acedrex, our featured variant for April, 2024.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Single Comment

How to Design and Post Your Own Game. A reference for those who want to post their own games here.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Mon, Nov 28, 2022 06:01 PM UTC:

I'm thinking of removing CKEditor from the site. In source mode, it has been reformatting text, which is annoying. I rewrote trim_lines to better handle ASCII diagrams, and it did a great job at that. In the test I ran, an ASCII diagram for Hexagonal Chess looked like this:

        a   b   c   d   e   f   g   h   i   j   k
                        ___
                    ___/ b \___                  8
                ___/:q:\___/:k:\___
            ___/!n!\___/!b!\___/!n!\___          7
        ___/ r \___/   \___/   \___/ r \___
    ___/:p:\___/:::\___/:b:\___/:::\___/:p:\___  6
   /!!!\___/!p!\___/!!!\___/!!!\___/!p!\___/!!!\
11 \___/   \___/ p \___/   \___/ p \___/   \___/ 5
   /:::\___/:::\___/:p:\___/:p:\___/:::\___/:::\
10 \___/!!!\___/!!!\___/!p!\___/!!!\___/!!!\___/ 4
   /   \___/   \___/   \___/   \___/   \___/   \
 9 \___/:::\___/:::\___/:::\___/:::\___/:::\___/ 3
   /!!!\___/!!!\___/!!!\___/!!!\___/!!!\___/!!!\
 8 \___/   \___/   \___/ P \___/   \___/   \___/ 2
   /:::\___/:::\___/:P:\___/:P:\___/:::\___/:::\
 7 \___/!!!\___/!P!\___/!!!\___/!P!\___/!!!\___/ 1
   /   \___/ P \___/   \___/   \___/ P \___/   \
 6 \___/:P:\___/:::\___/:B:\___/:::\___/:P:\___/
       \___/!R!\___/!!!\___/!!!\___/!R!\___/
 5         \___/ N \___/ B \___/ N \___/
               \___/:Q:\___/:K:\___/
 4                 \___/!B!\___/
                       \___/
     a   b   c   d   e   f   g   h   i   j   k

But when I load the content of the page in CKEditor, it looks like this:

<DIV>
  <PRE>
    a   b   c   d   e   f   g   h   i   j   k
    ___
    ___/ b \___                  8
    ___/:q:\___/:k:\___
    ___/!n!\___/!b!\___/!n!\___          7
    ___/ r \___/   \___/   \___/ r \___
    ___/:p:\___/:::\___/:b:\___/:::\___/:p:\___  6
    /!!!\___/!p!\___/!!!\___/!!!\___/!p!\___/!!!\
    11 \___/   \___/ p \___/   \___/ p \___/   \___/ 5
    /:::\___/:::\___/:p:\___/:p:\___/:::\___/:::\
    10 \___/!!!\___/!!!\___/!p!\___/!!!\___/!!!\___/ 4
    /   \___/   \___/   \___/   \___/   \___/   \
    9 \___/:::\___/:::\___/:::\___/:::\___/:::\___/ 3
    /!!!\___/!!!\___/!!!\___/!!!\___/!!!\___/!!!\
    8 \___/   \___/   \___/ P \___/   \___/   \___/ 2
    /:::\___/:::\___/:P:\___/:P:\___/:::\___/:::\
    7 \___/!!!\___/!P!\___/!!!\___/!P!\___/!!!\___/ 1
    /   \___/ P \___/   \___/   \___/ P \___/   \
    6 \___/:P:\___/:::\___/:B:\___/:::\___/:P:\___/
    \___/!R!\___/!!!\___/!!!\___/!R!\___/
    5         \___/ N \___/ B \___/ N \___/
    \___/:Q:\___/:K:\___/
    4                 \___/!B!\___/
    \___/
    a   b   c   d   e   f   g   h   i   j   k
  </PRE>
</DIV>

I can get it looking correct by turning CKEditor off, but it's still annoying.

Also, it has been treating unpaired tags as unclosed unless they end with /. Since it indents each unclosed tag further than the last one, things can easily get out of hand with lots of IMG or INPUT tags that do not have closing tags.

The WYSIWYG editor has filled a gap for people who don't know HTML, and it's a better option than writing everything in plain text. However, the option of using Markdown fills the same gap. Markdown is an intuitive markup language that borrows conventions common to plain text documents and replaces them with appropriate HTML. It is already the default format for entering comments, and you can see a Quick Markdown Guide if you look down while entering a comment in the Markdown format. Markdown combines the ease of writing a plain text document with the power of HTML.

And it also allows those who know HTML to mix in HTML with the Markdown.