Wikipedia talk:AutoEd/tablestowikitext.js

Latest comment: 11 years ago by Technical 13 in topic Comment about comments

Comment about comments

edit

Looks like a nice script. The only improvement I might suggest is that <tr>, <th>, and <td> can, and often do, have stuff too. For example:

<table border="1" width="300px">
  <tr style="background-color: #CCC; font-size: 16px;">
    <th  style="font-variant: small-caps; width: 150px;">A Header is good</th>
    <th width="150px"> A Header is okay</th>
  </tr>
  <tr style="text-align: center;">
    <td>Yes</td><td>No</td>
  </tr>
  <tr style="vertical-align: middle; background-color: #D99;">
    <td>OMG Yes, I so agree, did you hear what she said about her I mean that is soooo normal. I mean, what on Earth was he thinking she was going to do, make him a sammich and not expect to get a diamond ring in return.  That is so lame.</td>
    <td style="text-decoration: overline underline;">Please, God, no, stop, now.</td>
  </tr>
</table>

makes a table that looks like:

A Header is good A Header is okay
YesNo
OMG Yes, I so agree, did you hear what she said about her I mean that is soooo normal. I mean, what on Earth was he thinking she was going to do, make him a sammich and not expect to get a diamond ring in return. That is so lame. Please, God, no, stop, now.

By the looks of your script, a lot would be lost or fail to convert breaking the table. Just a thought. Technical 13 (talk) 12:23, 1 May 2013 (UTC)Reply

Oh, I was just reading the comments / script documentation. Looks like the script actually may copy all of that stuffs too. Nevermind, although someone may want to adjust the comments so that someone with less ability to read ReGex and Javascript will be able to clearly know what it is doing. Any admin should be able to do this, no?

Hello friendly responding admin. Can you modify the comments as follows:

  • Replace this line
    • with this one
  • // Replace '<tr>' with '|-'
    • // Replace '<tr stuff>' with '|- stuff'
  • // Replace '<td>' with '|'
    • // Replace '<td stuff>' with '| stuff |'
  • // Replace '<th>' with '!'
    • // Replace '<th stuff>' with '! stuff |'

Thank you. Technical 13 (talk) 12:36, 1 May 2013 (UTC)Reply

I don't see that this adds much to the descriptions which are perfectly accurate already. '<tr>' is replaced with '|-' and the "stuff" is unaffected. — Martin (MSGJ · talk) 12:00, 9 May 2013 (UTC)Reply
MSGJ, I agree that this is a minor change. The problem I had is that there is a description further up that says:
  • // Replace '<table stuff>' with '{| stuff'
which to me implies that the stuff is not included below as it is not declared as it was above. It is inconsistant and confusing. Please fix one or the other if you would be so kind. Thank you. Technical 13 (talk) 12:36, 9 May 2013 (UTC)Reply
Hopefully this is now resolved to your satisfaction. — Martin (MSGJ · talk) 13:59, 10 May 2013 (UTC)Reply
  Works for me Technical 13 (talk) 14:04, 10 May 2013 (UTC)Reply