Skip to content

Commit

Permalink
Posts have titles now.
Browse files Browse the repository at this point in the history
  • Loading branch information
zarate committed Nov 20, 2011
1 parent c868733 commit d413dfd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Main.hx
Expand Up @@ -156,7 +156,7 @@ class Main
backToIndexLink = "../" + backToIndexLink;
}

xa.File.write(postFolder + xa.System.UNIX_SEPARATOR + "index.htm", renderPage(postTemplate.execute({content: post.content, linkToIndex: backToIndexLink}), post.title));
xa.File.write(postFolder + xa.System.UNIX_SEPARATOR + "index.htm", renderPage(postTemplate.execute({content: post.content, title: post.title, linkToIndex: backToIndexLink}), post.title));
}
}

Expand Down
9 changes: 3 additions & 6 deletions src/Parser.hx
Expand Up @@ -27,16 +27,13 @@ class Parser

case "content:encoded":

var rawContent = element.innerData;

// as a rule of thumb, we DO need the raw HTML that's stored in the
// XML. However, we should at least escape the HTML that's wihin the
// code blocks.

// also we need to go from line break to <p>

var rawContent = element.innerData;
// [code][/code] blocks.

var escape = ~/\[code.*?\/code\]/s;

rawContent = escape.customReplace(rawContent, escapeHtml);

// then we need to go from the plain line breaks to brs
Expand Down
1 change: 1 addition & 0 deletions templates/post.html
@@ -1,3 +1,4 @@
<h1>::title::</h1>
<div>
::content::
</div>
Expand Down

0 comments on commit d413dfd

Please sign in to comment.