Skip to content

Commit 5ac9c5f

Browse files
committed
Removes iconv and closes #93
1 parent 5d56a15 commit 5ac9c5f

File tree

8 files changed

+19
-19
lines changed

8 files changed

+19
-19
lines changed

ChangeLog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
Version 1.4.0, October 11th, 2015
2+
=================================
3+
4+
- Fixes a bug on header rendering (closes #93)
5+
- Removes iconv and uses the transliteration module (finally!)
6+
7+
The version is coded 1.4.0 because removing iconv may create some regression of old installations.
8+
19
Version 1.3.1, October 4th, 2015
210
=================================
311

README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
[ ![Codeship Status for claudioc/jingo](https://www.codeship.io/projects/4c413870-353e-0132-115c-220292a78f73/status)](https://www.codeship.io/projects/40997)
44

5-
**Warning: the current version of Jingo (1.x.x) is relatively new and it has gone through some major rewrites. If you find yourself having problems with this version, you can still use the previous stable [version 0.6.1](https://github.com/claudioc/jingo/releases/tag/v0.6.1). If this is the case, please take a minute and fill out one [issue](https://github.com/claudioc/jingo/issues). And don't forget to take a look at the [list of changes](https://github.com/claudioc/jingo/blob/master/ChangeLog.md)!**
6-
75
JINGO
86
=====
97

@@ -140,11 +138,6 @@ If anonRead is false you need to authenticate also for reading and then the emai
140138

141139
The authentication is mandatory to edit pages from the web interface, but jingo works on a git repository; that means that you could skip the authentication altogether and edit pages with your editor and push to the remote that jingo is serving.
142140

143-
Common problems
144-
---------------
145-
146-
Sometimes upgrading your version of node.js could break the `iconv` module. Try updating it with `npm install iconv`.
147-
148141
Known limitations
149142
-----------------
150143

@@ -356,7 +349,7 @@ Configuration options reference
356349

357350
#### pages.title.asciiOnly
358351

359-
If this is set to true, Jingo will convert any non-Ascii character present in the title of the document to an ASCII equivalent (using iconv), when creating the filename of the document. Default was true for Jingo < 1.0 while for Jingo >= 1.0 the default is false
352+
If this is set to true, Jingo will convert any non-Ascii character present in the title of the document to an ASCII equivalent (using transliteration), when creating the filename of the document. Default was true for Jingo < 1.0 while for Jingo >= 1.0 the default is false
360353

361354
#### pages.title.lowercase
362355

jingo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var program = require('commander'),
1717

1818
global.Git = require('./lib/gitmech');
1919

20-
program.version('1.3.1')
20+
program.version('1.4.0')
2121
.option('-c, --config <path>', 'Specify the config file')
2222
.option('-#, --hash-string <string>', 'Create an hash for a string')
2323
.option('-l, --local', 'Listen on localhost only')

lib/namer.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
var Iconv = require("iconv").Iconv,
1+
var tr = require("transliteration"),
22
app = require("./app"),
33
Configurable = require("./configurable");
44

5-
var iconv = new Iconv("UTF-8", "ASCII//TRANSLIT//IGNORE");
65
var wsReplacement = "-";
76
var overrides = {};
87

@@ -35,9 +34,7 @@ Namer.prototype.wikify = function (str) {
3534
ret = ret.replace(/\//g, '+');
3635

3736
if (pc.title.asciiOnly) {
38-
ret = iconv.convert(ret)
39-
.toString()
40-
.replace(/[^a-zA-Z0-9\- _]/g, "");
37+
ret = tr(ret).replace(/[^a-zA-Z0-9\- _]/g, "");
4138
}
4239

4340
ret = ret.trim();

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jingo",
3-
"version": "1.3.1",
3+
"version": "1.4.0",
44
"description": "A nodejs based wiki engine (sort of Gollum port)",
55
"author": "Claudio Cicali <claudio.cicali@gmail.com>",
66
"keywords": [
@@ -32,7 +32,6 @@
3232
"express-session": "^1.9.3",
3333
"express-validator": "^2.7.0",
3434
"gravatar": "^1.1.0",
35-
"iconv": "*",
3635
"jade": "*",
3736
"js-yaml": "^3.1.0",
3837
"lodash": "^2.4.1",
@@ -45,7 +44,8 @@
4544
"passport-google-oauth": "^0.1.5",
4645
"passport-local": "^1.0.0",
4746
"semver": "^2.3.2",
48-
"serve-favicon": "^2.1.7"
47+
"serve-favicon": "^2.1.7",
48+
"transliteration": "^0.1.1"
4949
},
5050
"devDependencies": {
5151
"chai": "*",

routes/wiki.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function _getWikiPage(req, res) {
8989
res.render("show", {
9090
page: page,
9191
title: app.locals.config.get("application").title + " – " + page.title,
92-
content: renderer.render("#" + page.title + "\n" + page.content)
92+
content: renderer.render("# " + page.title + "\n" + page.content)
9393
});
9494
}
9595
else {

test/mocha.opts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
--reporter spec
22
--require test/support/setup
33
--check-leaks
4-
--recursive
4+
--recursive
5+
--globals strNew

test/spec/namerSpec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ describe("namer", function() {
5555
expect(namer.wikify("_Sidebar")).to.equal("_Sidebar");
5656
expect(namer.wikify("nell'aria")).to.equal("nellaria");
5757
expect(namer.wikify("Caffé")).to.equal("Caffe");
58+
expect(namer.wikify("àéîöū")).to.equal("aeiou");
5859
expect(namer.wikify("Caffé corretto!")).to.equal("Caffe-corretto");
5960
expect(namer.wikify("Per favore: nessun, dico; E un punto...")).to.equal("Per-favore-nessun-dico-E-un-punto");
6061
expect(namer.wikify("prova.md")).to.equal("provamd");

0 commit comments

Comments
 (0)