Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let 'plain' option actually produce plain output. #2

Merged
merged 1 commit into from
Sep 30, 2013
Merged

Let 'plain' option actually produce plain output. #2

merged 1 commit into from
Sep 30, 2013

Conversation

xsc
Copy link
Collaborator

@xsc xsc commented Sep 30, 2013

As discussed in #1, this pull request fixes the handling of the command line option plain (and the subsequent use of the affected var *plain*). I'll have a look at escaping the contents of the <pre> blocks if you want to. Should be possible with something like:

(clojure.string/escape "<title>" { \< "&lt;" \> "&gt;" \& "&amp;" })
;; => "&lt;title&gt;"

That would remove most problematic cases, I guess.

zcaudate pushed a commit that referenced this pull request Sep 30, 2013
Let 'plain' option actually produce plain output.
@zcaudate zcaudate merged commit af420bc into zcaudate-me:master Sep 30, 2013
@zcaudate
Copy link
Member

Thanks mate! Really appreciate your help!

@xsc xsc deleted the fix-plain-mode branch September 30, 2013 13:18
@xsc
Copy link
Collaborator Author

xsc commented Sep 30, 2013

Always happy to help!

@zcaudate
Copy link
Member

Hmmm... this <pre> rendering business is tough.... I've run plain on the document and half of it is not rendering properly. I wonder if for now, its better to take away this option completely

@xsc
Copy link
Collaborator Author

xsc commented Oct 5, 2013

Did you try including the clojure.string/replace call (in the *plain* case, obviously) I posted in the text of this pull request above? I'd be surprised if that didn't at least get us closer to a solution.

If you don't have the time, I can try it myself, of course. :)

@zcaudate
Copy link
Member

zcaudate commented Oct 5, 2013

Hey Yannick!

I've added you to the GitHub so free to push into the lib. I'm a bit behind on work atm so any help is greatly appreciated :)

On 05/10/2013, at 23:10, Yannick Scherer notifications@github.com wrote:

Did you try including the clojure.string/replace call (in the plain case, obviously) I posted in the text of this pull request above? I'd be surprised if that didn't at least get us closer to a solution.

If you don't have the time, I can try it myself, of course. :)


Reply to this email directly or view it on GitHub.

@xsc
Copy link
Collaborator Author

xsc commented Oct 5, 2013

Thank you very much! I implemented basic HTML escaping in this commit. Since this is not the most critical of issues I'll not merge into master until you've reviewed the changes.

Good luck with your work and have a nice day!

@zcaudate
Copy link
Member

zcaudate commented Oct 5, 2013

Btw. Off topic.

Is there a way for rewrite-clj to output the line number of the element it is currently on. I've seen it there when the parser comes across an error but i'm not sure of the function call that does this.

This will be very useful for tagging code in the readmes.

On 06/10/2013, at 0:42, Yannick Scherer notifications@github.com wrote:

Thank you very much! I implemented basic HTML escaping in this commit. Since this is not the most critical of issues I'll not merge into master until you've reviewed the changes.

Good luck with your work and have a nice day!


Reply to this email directly or view it on GitHub.

@zcaudate
Copy link
Member

zcaudate commented Oct 6, 2013

Hey Yannick!

I've had a look and it's good to commit. It's really good to have another on the code. Luckily for me, you're also more careful with details than I am :)

On 06/10/2013, at 0:42, Yannick Scherer notifications@github.com wrote:

Thank you very much! I implemented basic HTML escaping in this commit. Since this is not the most critical of issues I'll not merge into master until you've reviewed the changes.

Good luck with your work and have a nice day!


Reply to this email directly or view it on GitHub.

@xsc
Copy link
Collaborator Author

xsc commented Oct 7, 2013

Luckily for me, you're also more careful with details than I am :)

Am I though? (Looking at you, namespaced keywords...)

Is there a way for rewrite-clj to output the line number of the element it is currently on.

The information is there at parsing time but the only way to generate it afterwards (currently) is by counting the :newline nodes. I'll think of something.

I've had a look and it's good to commit.

Very well, merging initiated. :)

@zcaudate
Copy link
Member

zcaudate commented Oct 7, 2013

Hahaha... Well you did get the rest of the language :)

I tried a number of parsers before rewrite-clj - they were all too complicated. I even tried to write my own instaparser and it was the slowest parser I had ever seen...

On 07/10/2013, at 18:23, Yannick Scherer notifications@github.com wrote:

Luckily for me, you're also more careful with details than I am :)

Am I though? (Looking at you, namespaced keywords...)

Is there a way for rewrite-clj to output the line number of the element it is currently on.

The information is there at parsing time but the only way to generate it afterwards (currently) is by counting the :newline nodes. I'll think of something.

I've had a look and it's good to commit.

Very well, merging initiated. :)


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants