Oops, forgot about the indenting -- just replace all spaces with " ":

{{=XML(site.other.replace('\n', '<br>').replace(' ', '&nbsp;'),
       sanitize=True, permitted_tags=['br/'])}}

Anthony

On Thursday, October 20, 2016 at 2:29:51 PM UTC-4, Steven Vannoy wrote:
>
> Thanks, the replace option from @Anthony worked pretty well, it got the 
> new lines but didn't provide indentation (as expected). The <pre></pre> 
> tags get both, and I like the font well enough except that it is a lighter 
> gray on a gray background so if I can manage to get that changed I'll 
> probably go with that option.
>
> Yes Dave, you were right it wasn't stripping the asterisks but wasn't 
> rendering them the way I would like. 
>
> Steven
>
>
> On Thu, Oct 20, 2016 at 2:07 PM, Anthony <[email protected]> wrote:
>
>> On Thursday, October 20, 2016 at 2:01:09 PM UTC-4, Dave S wrote:
>>>
>>>
>>> I'm going to go out on a limb, and opine that you never even get the 
>>> newlines or indentation (but do get the asterisks), all that having been 
>>> stripped out by the textarea input control.
>>>
>>
>> No, a textarea does preserve newlines.
>>
>> Anthony
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/WM3hhsJVUYU/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to