implement raw view
Ticket
+issues
Returns card's content completely unprocessed. You'll get the content straight from the database, brackets, braces, and all.
(Note: raw used to mean what is now meant by naked.)
Once this is done it might be easier to make edit markup visible without edit permission
Created http://test.dwagn.org/wagn/testing_raw and things mostly look okay. HTML is being interpreted, and it looks like the Ruby card is as well - is that what we want? Also, Script cards don't seem to be turned on there, so i couldn't test those. I think i hit all the other built in types.
User cards seem broken in a weird way, but this may be related to form brokenness in current test code.
--John Abbe.....Tue Apr 13 21:19:49 -0700 2010
raw means totally unprocessed -- we just output straight from the database.
So for html, that means we just take the HTML from the database and put it out. The browser then interprets it, of course. If we want to see the HTML, we have to escape it. But that's processing -- that's not raw.
However, it's easy enough to build escaping with ruby cards. See http://test.dwagn.org/wagn/some_HTML+escape (I'd want to improve that -- quotes could bust it). What do you think about an approach like that? It seems consistent with how our users interact with HTML most of the time...
As for user cards, what's happening is that it's rendering the raw content of the John Abbe card. you could make a case for rendering the raw content of the *content card instead. not sure I have a strong opinion here, except that the current route is the simplest one.
--Ethan McCutchen.....Wed Apr 14 12:15:23 -0700 2010
I think User begs another idea/ticket - improve raw view of content-formatted cards.
I like the +escape trick. Any reason not to copy your current solution to English? Or do you want to improve it first?
Ruby seems okay now, don't remember what it was doing before. What about Script cards?
--John Abbe.....Fri Apr 16 08:59:42 -0700 2010
Ruby wasn't showing up raw before because you hadn't given it "raw" view. It was therefore showing content view (and therefore rendering a ruby error).
The escape solution is not ready for English because it will break if the content has quotation mark.
I commented on the idea.
--Ethan McCutchen.....Fri Apr 16 09:20:29 -0700 2010
Objections to closing this one?
--Ethan McCutchen.....Fri Apr 16 09:20:46 -0700 2010
What about Script cards?
--John Abbe.....Fri Apr 16 10:22:57 -0700 2010
it would just show the raw script. Don't think we even really need to test.
The only code involved in implement this is the following:
when :raw; card.content
--Ethan McCutchen.....Fri Apr 16 10:59:13 -0700 2010