Jump to content

Wikipedia talk:AutoEd/tablestowikitext.js

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

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]