tstaerk / mediasyntax

Mediasyntax is a plugin for Dokuwiki that enables Mediawiki syntax.
http://www.staerk.de/thorsten/Mediasyntax
GNU General Public License v2.0
10 stars 6 forks source link

problem with fixed code (table conversion) #9

Closed Mikioni closed 12 years ago

Mikioni commented 12 years ago

I retest the fixed code, but seems like it still can't convert correctly for just table conversion, and will hang on normal conversion.

example 1: | Name 1 | Address 1 | | Name 2 | Address 2 |

output : - Name 1 Address 1
'''Name 2''' '''Address 2'''
-
}

example 2 : (will hang) ====== Title ======

[[DEMO Link]]

| Name | Address |

output : ====== Title ======

at terminal : (stop at here) 0====== Title ====== 1 - [[DEMO Link]]

tstaerk commented 12 years ago

fixed: https://github.com/tstaerk/mediasyntax/commit/1249c6504ec17fbfbb12e06550147891c9f55dc5

Mikioni commented 12 years ago

Tested with example below, still got some problems after converted.

example : ====== Level 1 Headline ====== ===== Level 2 Headline ===== ==== Level 3 Headline ==== === Level 4 Headline === == Level 5 Headline ==

| Name | Address | | Name 2 | Address 2 |

output : ====== Level 1 Headline ====== ===== Level 2 Headline ===== ==== Level 3 Headline ==== === Level 4 Headline === == Level 5 Headline ==

[[DEMO Link]]

{ class="wikitable sortable" border=1
Name Address
-
'''Name 2''' '''Address 2'''
-
}

note : mediawiki's format : = Level 1 = == Level 2 == === Level 3 === ==== Level 4 ==== ===== Level 5 ===== ====== Level 6 ======

should be only one #(.1)

|| after Address and Address 2 should be removed in order to display correctly.

tstaerk commented 12 years ago

thank you for your continued reports. Together we will get this done!!!

tstaerk commented 12 years ago

headings and ordered list fixed: https://github.com/tstaerk/mediasyntax/commit/ce2817279af475badfa6a5dabb30c039c0b1e122

Mikioni commented 12 years ago

Tested, the headings look correct now, but double hash sign(#) and the ' || ' still there.

output : = Level 1 Headline = == Level 2 Headline == === Level 3 Headline === ==== Level 4 Headline ==== ===== Level 5 Headline =====

[[DEMO Link]] <--- should be only one (#) otherwise it will display two (1.) in mediawiki.

{ class="wikitable sortable" border=1
Name Address <--- the ' ' (right hand side) shouldn't appear in order to display correctly
-
'''Name 2''' '''Address 2''' <--- the ' ' (right hand side) shouldn't appear in order to display correctly
-
}
tstaerk commented 12 years ago

Fixed: https://github.com/tstaerk/mediasyntax/commit/c172e6bb7ad86f2d780bf1870120937d74c5312c

Mikioni commented 12 years ago

Tested, table look ok now, problem with double hash sign(#) still there.

output : = Level 1 Headline = == Level 2 Headline == === Level 3 Headline === ==== Level 4 Headline ==== ===== Level 5 Headline =====

'#''#' [[DEMO Link]] <--- two hash (#) still there.

{ class="wikitable sortable" border=1
Name Address
-
'''Name 2''' '''Address 2'''
-
}
tstaerk commented 12 years ago

I cannot reproduce that there are two hashes, there is one for me. I am using the testcase from mediasyntax/test/dokusyntax-test.txt

Mikioni commented 12 years ago

Strange, mine converted with two hashes. it will show the order list with two 1. 1. in mediawiki. :\

tstaerk commented 12 years ago

Mikioni,

I have added your testcase to mediasyntax' distribution. Please try the following:

/srv/www/htdocs/staerk/dokuwiki/lib/plugins/mediasyntax # php tools/dokuwiki2mediawiki.php test/dokusyntax-test.txt

and you should see ONE hash left of the [[DEMO Link]] Do you?

Mikioni commented 12 years ago

Tested, I found that putting a dash(-) in front of [[DEMO]] with no space/only one space will converted to one hash. but in dokuwiki there are two spaces before dash(-) for order list. so i think the problem is the converter can't convert to one hash because of two spaces in front.

example : '-' [[DEMO Link]] '-' [[DEMO Link]] '-' [[DEMO Lnki]]

output :

[[DEMO]]

[[DEMO]]

[[DEMO]]

Mikioni commented 12 years ago

repost : because above comment will auto skip space, and display as bold for [[DEMO Link]]

Tested, I found that putting a dash(-) in front of [[DEMO]] with no space/only one space will converted to one hash. but in dokuwiki there are two spaces before dash(-) for order list. so i think the problem is the converter can't convert to one hash because of two spaces in front.

example : '-' [[DEMO Link]] <--- no space '-' [[DEMO Link]] <--- one space '-' [[DEMO Lnki]] <--- two spaces

output : '#' [[DEMO Link]] '#' [[DEMO Link]] '#''#' [[DEMO Link]]

tstaerk commented 12 years ago

Can you look at the test case https://github.com/tstaerk/mediasyntax/blob/master/test/dokusyntax-test.txt#L25 There I put two spaces, then one dash. And this gets converted to one hash for me. What if you convert this test case?

Mikioni commented 12 years ago

tested, Still get two hash(#)

output : this is ''italic''

This is a list '#''#' this is item 1 <--- separate with '' so that you can see the hashes.

{ class="wikitable sortable" border=1 ! Car !! Colors !! Producer !!
Audi A5 black VAG
-
::: blue :::
-
::: silver :::
-
::: white :::
-
BMW 3 blue BMW
-
::: white :::
-
::: silver :::
-
}
Now a table without headers follows: { class="wikitable sortable" border=1
col 1 col 2
-
field 3 4
-
}

= Level 1 Headline = == Level 2 Headline == === Level 3 Headline === ==== Level 4 Headline ==== ===== Level 5 Headline =====

'#''#' [[DEMO Link]] <--- separate with '' so that you can see the hashes.

{ class="wikitable sortable" border=1
Name Address
-
'''Name 2''' '''Address 2'''
-
}
tstaerk commented 12 years ago

Added a special test case for this issue. Please git pull, then mediasyntax # php tools/dokuwiki2mediawiki.php test/issue9 output contains one hash for me. How many for you?

Mikioni commented 12 years ago

When git pull get this message " fatal: No remote repository specified. Please, specify either a URL or a remote name from which new revisions should be fetched. "

tstaerk commented 12 years ago

either this is an outage of github or you are not in the mediasyntax folder or you have not done git clone https://github.com/tstaerk/mediasyntax.git before

Mikioni commented 12 years ago

Tested, output with one hash now. Found another issue - converter will hang when trying to convert unorder list.

example : ====== Level 1 Headline ====== ===== Level 2 Headline ===== ==== Level 3 Headline ==== === Level 4 Headline === == Level 5 Headline ==

'-' [[DEMO Link]] '-' [[DEMO Link]] '-' [[DEMO Link]]

| Name | Address | | Name 2 | Address 2 |

' * ' New Line <--- will hang when this line is added. note: two space before star(*).

tstaerk commented 12 years ago

corrected, please update https://github.com/tstaerk/mediasyntax/commit/5ee1ed160c27ab041dcb19c476b2e71b6ab31a37

Mikioni commented 12 years ago

still got problem, converted to bold ?

output : = Level 1 Headline = == Level 2 Headline == === Level 3 Headline === ==== Level 4 Headline ==== ===== Level 5 Headline =====

{ class="wikitable sortable" border=1
Name Address
-
'''Name 2''' '''Address 2'''
-
}

''' New Line <<-- display as bold in mediawiki

tstaerk commented 12 years ago

what is converted to bold?

Mikioni commented 12 years ago

star(*) converted to (''') , New Line example above.

tstaerk commented 12 years ago

here is what I do:

git clone https://github.com/tstaerk/mediasyntax.git cd mediasyntax php tools/dokuwiki2mediawiki.php test/dokusyntax-test.txt

the result's last line is

so, works as designed. What do you do to get three apostrophes?