claudioc / jingo

Node.js based Wiki
MIT License
1.02k stars 184 forks source link

Title page and titles without space between #and text are not displayed correctly. #93

Closed carllapa closed 8 years ago

carllapa commented 9 years ago

The Markup code:

jingo title problem_02

The result:

jingo title problem_01

As you can see in the images, when a title doesn't have a blank space after # it's not displayed ok.

I've installed latest version of Jingo using npm v2.13.4 and node v0.12.2.

claudioc commented 9 years ago

Hi,

I will take a closer look at this issue, but I am afraid it's a problem with the Markdown parser (which I didn't write).

J3rome commented 9 years ago

The problem is located at line 92 of the file /routes/wiki.js

res.render("show", {
        page: page,
        title: app.locals.config.get("application").title + " – " + page.title,
        content: renderer.render("#" + page.title + "\n" + page.content)
      });

There is simply a space missing between the # and the page.title

To fix the problem, simply change the line content to

content: renderer.render("# " + page.title + "\n" + page.content)
achimwessling commented 9 years ago

Yeah, that's right. I had this problem also and solved it the same way.

carllapa commented 9 years ago

Thank you both for the answer, you saved me a lot of time debbuging the code :)

claudioc commented 9 years ago

Uhm, interesting. I cannot replicate the problem on the current version. Do you mind trying with the current version?

J3rome commented 9 years ago

I am using the latest version. I forked the Repo couple days ago

claudioc commented 9 years ago

Damn... node 0.12 on OSX 10.10.4

screen shot 2015-09-02 at 20 01 17 screen shot 2015-09-02 at 20 02 02
J3rome commented 9 years ago

Running it on node 0.10.25 on ubuntu 14.04. I will try to upgrade it soon and see if I get the same behaviour has you

achimwessling commented 9 years ago

I'm on window$ with iojs 3! So this is probably the difference.

I also replaced iconv with iconv-lite, because the installation process of iconv on window$ isn't a fun. So if one of you is interested he is welcome to look at https://github.com/achimwessling/jingo/commit/06a09a796e12968b3158f8c9f691b1b220f10d77 .

Achim

J3rome notifications@github.com schrieb am Mi., 2. Sep. 2015 um 20:25 Uhr:

Running it on node 0.10.25 on ubuntu 14.04. I will try to upgrade it soon and see if I get the same behaviour has you

— Reply to this email directly or view it on GitHub https://github.com/claudioc/jingo/issues/93#issuecomment-137199699.

claudioc commented 8 years ago

I upgraded to Node 4.1.x and now I have this problem. Going to fix it. @achimwessling interesting idea, using iconv-lite! Will try to add it to 1.3.2 Thanks to you all

claudioc commented 8 years ago

Fixed in 1.4.0 and removed iconv completely (with https://github.com/andyhu/node-transliteration), because this is what I used iconv for (iconv-lite does not transliterate)

achimwessling commented 8 years ago

Thanks Claudio,

looks great!

Achim

Claudio Cicali notifications@github.com schrieb am So., 11. Okt. 2015 21:03:

Fixed in 1.4.0 and removed iconv completely (with https://github.com/andyhu/node-transliteration), because this is what I used iconv for (iconv-lite does not transliterate)

— Reply to this email directly or view it on GitHub https://github.com/claudioc/jingo/issues/93#issuecomment-147235492.