Skip to content

Commit 10fa6a2

Browse files
committed
Merge branch 'gh-pages' of https://github.com/LivelyKernel/lively4-core into gh-pages
2 parents fa242f8 + 57ab579 commit 10fa6a2

File tree

5 files changed

+35
-4
lines changed

5 files changed

+35
-4
lines changed

doc/journal/2020-11-30.md/index.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## 2020-11-30 #Server #Testing #Issue
2+
*Author: @JensLincke*
3+
4+
5+
## How to Automate this Test?
6+
7+
1. Setup:
8+
```javascript
9+
lively.files.saveFile("http://localhost:9006/Dropbox/Thesis/Literature/_misc/foo.md", "test content")
10+
```
11+
12+
2. Test:
13+
```javascript
14+
fetch("http://localhost:9006/Dropbox/Thesis/Literature/_misc/foo.md", {
15+
method: "MOVE",
16+
headers: {
17+
destination: "http://localhost:9006/Dropbox/Thesis/Literature/_misc/" + encodeURI("foo―é.md")
18+
}
19+
}).then(r => r.text())
20+
```
21+
22+
3. check that there is not error... and the file is there?

src/client/bibliography.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Bibliography.cleanTitle("{{This is my Title}}")
104104
MD*/
105105

106106
static cleanTitle(titleString="") {
107-
return titleString.replace(/[{}]/g,"").replace(/[]/g," ")
107+
return titleString.replace(/[{}:\[\]]/g,"").replace(/[]/g," ")
108108
}
109109

110110
// #TODO this method obviously will need a lot of tweaking...

src/components/tools/literature-listing.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default class LiteratureListing extends Morph {
6565
// reset entries
6666
this.literatureFiles.forEach(literatureFile => literatureFile.entry = null)
6767

68-
entries.forEach(entry => {
68+
await entries.forEach(entry => {
6969
this.literatureFiles.filter(ea => ea.key == entry.key).forEach(literatureFile => {
7070
literatureFile.entry = entry
7171
})
@@ -172,6 +172,7 @@ export default class LiteratureListing extends Morph {
172172
}
173173

174174
renderLiteratureFile(literatureFile) {
175+
debugger
175176
var entryDetails = literatureFile.entry ?
176177
<span>
177178
<span class="authors">{literatureFile.entry.authors.join(", ")}</span>.

src/components/tools/lively-container.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,13 +831,13 @@ export default class Container extends Morph {
831831
async renameFile(url, followFile=true, proposedNewName) {
832832
url = "" + url
833833
var base = url.replace(/[^/]*$/,"")
834-
var name = proposedNewName || url.replace(/.*\//,"")
834+
var name = proposedNewName || decodeURI(url.replace(/.*\//,""))
835835
var newName = await lively.prompt("rename", name)
836836
if (!newName) {
837837
lively.notify("cancel rename " + name)
838838
return
839839
}
840-
var newURL = base + newName
840+
var newURL = base + encodeURI(newName)
841841
if (newURL != url) {
842842
await files.moveFile(url, newURL)
843843

test/bibliography-test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,14 @@ describe('Bibliography', () => {
215215
expect(key).to.equal("Guenter1998ECC")
216216
});
217217

218+
it('stripps colon', async function() {
219+
var key = Bibliography.generateCitationKey({entryTags: {
220+
author: `Ken Perlin and Zhenyi He and Karl Rosenberg`,
221+
year: 2018,
222+
title: "Chalktalk : A Visualization and Communication Language -- As a Tool in the Domain of Computer Science Education",
223+
}})
224+
expect(key).to.equal("Perlin2018CVC")
225+
});
218226
})
219227

220228
});

0 commit comments

Comments
 (0)