GoogleCodeArchive / tapirwiki

Automatically exported from code.google.com/p/tapirwiki
1 stars 0 forks source link

Parser not picking up CamelCase links or {goto:link} macro in lists #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Make a list with # or * and on the same line try to use a "magic"
CamelCase or {goto:link} macro

What is the expected output? What do you see instead?
Expected a link when page is rendered, but no link there. Same problem
should occur in headings or tables or any textile formatted line.

What version of the product are you using? On what operating system?
Latest, Linux

Please provide any additional information below.
I made a quick fix in attached file. Also patch included.

Original issue reported on code.google.com by jeroen....@gmail.com on 21 Feb 2010 at 12:44

Attachments:

GoogleCodeExporter commented 9 years ago
Good spot.

I will look at getting a new release out with your fix ASAP. Thanks.

Original comment by Joshua.e.Knight on 22 Feb 2010 at 8:05

GoogleCodeExporter commented 9 years ago
Fixed in v0.3.1, now available for download.

Original comment by Joshua.e.Knight on 22 Feb 2010 at 8:35

GoogleCodeExporter commented 9 years ago
Hi, thanks for prompt action. But the problem seems wider. The javascript 
engine for
textile to html conversion does not seem to be a proper implementation. You 
can't
combine the textile elements: you can only have one format per line. It does 
not for
example recognize line breaks within a block quotation (bq.) There should be 
better
javascript engines around? I think this is quite critical for usability.

Original comment by jeroen....@gmail.com on 23 Feb 2010 at 3:11

GoogleCodeExporter commented 9 years ago
Further to above post, on using it more thorougly I ran into the problem that 
all
camelcase is made into links even if part of an url. So fix was too quick. A 
better
solution should be found. The camelcase regex perhaps should check that it is 
not
preceded by a slash.

I am puzzled your new release does not solve the problem of camelcase within 
lists?

Perhaps http://jrm.cc/extras/live-textile-preview.php has a better javascript 
textile
processor? In any case formatting and links within lists work there.

Original comment by jeroen....@gmail.com on 23 Feb 2010 at 5:01

GoogleCodeExporter commented 9 years ago
Yeah, that parser does look a lot neater. 

I've mailed the author RE including it in TapirWiki (thought it would be nice 
to ask!)

I will update when I have a response.

Original comment by Joshua.e.Knight on 23 Feb 2010 at 7:30

GoogleCodeExporter commented 9 years ago
Hi, I played around with the parser I suggested but it is not as complete as 
the one
currently being used. In fact the one currently in use is suitable. The block 
quote
problem I mentioned is non existent, you just have to use bq.. instead of bq. on
their website http://www.ben-daglish.net/textile/test.html you can see it is 
actually
a quite complete implementation.

I have finally nailed down the problem with CamelCase inside lists. My previous 
fix
was a bit too hasty. It has to be fixed in the prep function. Attached the 
modified
file. I think you can compare with the latest yourself. Also I think I improved 
on
the CamelCase regular expression. Now it doesnt make 'LinkLink' a link in the 
word
myLinkLink. The CamelCase should start with a capital. It will also not 
generate a
link if you use camelcase in url. Finally you can now suppress the camelcase by
letting it precede with an exclamation mark. As javascript does not implement
'lookaround' regular expressions I had to use a bit of a workaround.

Looking into the search function. Actually it can be solved with lucene
(http://github.com/rnewson/couchdb-lucene) but it requires Java. The Xapian 
(python)
solution at http://code.google.com/p/couchprojects/wiki/FullTextIndexing 
doesn't seem
to work in CouchDB version 0.10. At least I couldn't get it working. It 
probably has
to be tweaked. 

Finally, perhaps you should think about an install page instead of putting all 
the
installation code in the wiki page. The install page could probably create the 
design
documents to hold the java script and install the wiki page etc. The wiki page 
itself
could then be much neater.

Original comment by jeroen....@gmail.com on 25 Feb 2010 at 5:49

Attachments:

GoogleCodeExporter commented 9 years ago
Oops. Regular expressions in JavaScript are knotty. One bug removed.

Original comment by jeroen....@gmail.com on 25 Feb 2010 at 6:56

Attachments:

GoogleCodeExporter commented 9 years ago
Tried to improve the textile parser further by properly handling code blocks. 
When
using attached file code in between @'s on the same line or in code blocks 
(first
line preceded by "bc.") is not parsed any longer and html characters are 
substituted
by entities. 

Original comment by jeroen....@gmail.com on 27 Feb 2010 at 5:19

Attachments:

GoogleCodeExporter commented 9 years ago
Two little bugs removed. 

Original comment by jeroen....@gmail.com on 28 Feb 2010 at 11:33

Attachments:

GoogleCodeExporter commented 9 years ago
Please test this version which includes your fixes. If you are happy that your 
issue is 
resolved, please update this issue and I will release this version.

This also addresses issue 2 (delete prompt).

Thanks again for your help in raising / fixing these issues. 

Original comment by Joshua.e.Knight on 1 Mar 2010 at 8:08

GoogleCodeExporter commented 9 years ago

Original comment by Joshua.e.Knight on 1 Mar 2010 at 8:08

GoogleCodeExporter commented 9 years ago
I have been working on the textile parser to make it fully compliant with the 
textile
standard (2.0) on http://textile.thresholdstate.com/ . I think it now 
implements most
(and also removed a bug from the version published with comment 9. I put the
Javascript in the your latest version downloaded from issue 2. The delete page 
seems
to work fine. So perhaps you can test the parser a bit and then release. 

Original comment by jeroen....@gmail.com on 4 Mar 2010 at 9:34

Attachments:

GoogleCodeExporter commented 9 years ago
While using, came across another awkward thing of the textile parser. New lines 
were
not translated into linebreaks! Corrected that in enclosed version. Actually, 
the
original javascript parser is not that good, a bit hackish. Should really be
rewritten completely. In the mean time we make do with this modified version.

Original comment by jeroen....@gmail.com on 5 Mar 2010 at 4:02

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
One more bug in the original script: if you try to put the first word on a line 
in
boldface the script interprets it as a list item. The asterisk of a list item 
should
be followed by a space. Attached resolves this.

Original comment by jeroen....@gmail.com on 8 Mar 2010 at 2:47

Attachments:

GoogleCodeExporter commented 9 years ago
I've completely rewritten the textile parser/renderer. It now works recursively
parsing the text into a tree structure. That tree structure is then rendered by 
a
renderer into html. In between the TapirWiki macros are parsed and rendered. The
previous parser worked on a line-by-line basis which makes it brittle as 
textile is
simplified html which fundamentally is a tree structure.
I have also refactored TapirWiki into a CouchApp to make it more easy to 
develop and
maintain. All changes have been put in a clone at:
http://code.google.com/r/jeroenvet-tapirwiki-as-a-couchapp/ . This was also 
announced
on the Couchapp mailing list which elicited some good feedback at:
http://groups.google.com/group/couchapp/browse_thread/thread/3feb99b0ebf31dc7
I hope to have contributed to a more solid basis of TapirWiki on which we can 
now add
more functionality (like page back & forward, bread crumbs, search, option to 
use
markdown, more macros etc.)
Cheers!

Original comment by jeroen....@gmail.com on 23 Apr 2010 at 2:04