Skip to content

Commit

Permalink
remove <hr> before eof
Browse files Browse the repository at this point in the history
  • Loading branch information
jokester committed Nov 19, 2016
1 parent cb8c3aa commit 83164cf
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 14 deletions.
2 changes: 0 additions & 2 deletions content/HPL/Beyond-The-Wall-of-Sleep.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,3 @@ _[注1:御夫座中的一颗双星]_
_[注2:这是一颗真实存在的超新星,于1901年出现并在同年被Felipe Rivera Parra最早发现,在爆发时,该新星的亮度一度达到0.2等,之后逐渐黯淡到12至13等星。]_

### The End

-----------
2 changes: 0 additions & 2 deletions content/HPL/Cool-Air.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,3 @@
那恶臭的潦草笔记上写着:“到此为止了,没有冰块了——那个人看了一眼,然后跑掉了。每分钟都在变得更暖和,血肉已经无法再维持下去。我想你知道——我说过的,意志与神经系统还有保存完好的身体能够在器官停止工作后仍能继续运作。这是个好理论,却不能一直持续下去。我没有预见到会发生逐渐的恶化。托里斯医生知道这件事,但那次惊吓杀死了他。他没有办法忍受那些他必须要做的事情——当他留意到我的信,并将我带回来时,他必须在一个黑暗而奇怪的地方找到我。可是器官永远也无法再工作了。事情必须要按我这样来做——人工地保存好一切——_你是知道的,十八年前的那个时候,我就已经死了。_

### The End

-----------
2 changes: 0 additions & 2 deletions content/HPL/The-Call-of-Cthulhu-Frend.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,5 +277,3 @@ _[注:波吕斐摩斯曾捕捉并囚禁了奥德修斯与他船员供自己食
克苏鲁也还活着,我猜。它又回到了早在太阳尚且年轻时就一直庇护着它的石头裂缝之中。它被诅咒的城市再一次沉没了,因为警戒号在四月的风暴之后曾航行穿过了那片水域;但它在地球上的祭司们依旧在某些偏远的地方围绕着供奉偶像的独石咆哮、跳跃、杀戮。他肯定在沉没时被困在了自己的黑暗深渊里,否则整个世界必定会在恐惧与疯狂中高声尖叫。谁知道最后会如何呢?升起的或许会沉没,而沉没的也将会升起。可憎之物在深渊里等待着、长梦着,而腐朽在摇摇欲坠的人类都市中播散扩张。一个时代终会到来——但我不愿去想,也不能去想!我祈祷,如果我在死前未能销毁这份手稿,我的遗嘱执行人会谨慎行事,不至鲁莽妄为,别再让它暴露在其他人的眼前。

### The End

-----------
2 changes: 0 additions & 2 deletions content/HPL/The-Challenge-from-Beyond.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,5 +223,3 @@ _[注:原文是 it will destroy itself in seeking to return to the slime from
在时空连续体的遥远彼端,那个殷红色的圆形耶库伯神明对乔治·坎贝尔如此说到。而后者已经清除了一切属于人类的欲望,此时正坐在王座上,统治着一个属于蠕虫们的帝国。他的统治将会比地球上任何一位统治人类帝国的君主更加智慧、更加和蔼、更加仁慈。

### The End

-----------
2 changes: 0 additions & 2 deletions content/HPL/The-Crawling-Chaos.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,3 @@ _[注4:原文为Cytharion ]_
当浓烟散去,再度望向地球的时候,我只在一片冰冷星云的衬托下看见垂死的太阳与黯淡悲恸的行星们还在寻找它们的姐妹。

### The End

-----------
2 changes: 0 additions & 2 deletions content/HPL/The-Mound.md
Original file line number Diff line number Diff line change
Expand Up @@ -503,5 +503,3 @@ _[注:没错Trowbridge St.特洛桥大街...]_
——“由无头躯体缇拉-娅布依昆扬之意志所抓获。”

### The End

-----------
8 changes: 8 additions & 0 deletions tools/lib/filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export function filter_md(md: string): string {
.bind(format_parts)
.bind(format_metadata)
.tap(removeConsecutiveHR)
.bind(dropLastHR)
.toArray();

return newLines.join("\n\n") + "\n";
Expand Down Expand Up @@ -141,3 +142,10 @@ function trimLeft(line: string): string {
function trimRight(line: string): string {
return line.replace(/\s*$/, '');
}

function dropLastHR(line: string, lineNum: number, wholeArray: string[]): string[] {
if (line === hr && lineNum === (wholeArray.length-1))
return [];

return [line];
}
4 changes: 2 additions & 2 deletions tools/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ export class ArrayM<T> {
/**
* >>=
*/
bind<T2>(action: (v: T, index?: number) => T2[]): ArrayM<T2> {
bind<T2>(action: (v: T, index?: number, wholeArray?: T[]) => T2[]): ArrayM<T2> {
let result = [] as T2[];

this.array.forEach((v, i) => {
const r = action(v, i);
const r = action(v, i, this.array);
result = result.concat(r);
})

Expand Down

0 comments on commit 83164cf

Please sign in to comment.