-
Notifications
You must be signed in to change notification settings - Fork 94
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
Leading whitespace not rendered #2
Comments
I am not sure I understand the problem. Which white space is ignored? |
Sorry, now github stripped the leading whitespace from the code or there is some special whitespace character going on. Attaching the source: |
|
i.e. line 6 should have a string with a bunch of leading spaces. Is strip() called somewhere? |
If you want the leading spaces use Pre instead of Div: |
WolfgangFahl
pushed a commit
that referenced
this issue
Aug 20, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With a slight tweak to the tutorial, I'm noticing it's not rendering the leading-whitepace on many of the lines in my browser.
Example code:
import justpy as jp
string = [
'JustPy',
'',
' What is JustPy?',
' Introduction',
' Hello World!',
' Under the Hood',
' News and Updates',
' License',
' Tutorial',
' Getting Started',
' Basic Concepts',
' Handling Events',
' HTML Components',
]
def my_click(self, msg):
self.text = 'I was clicked!'
def hello_world():
wp = jp.WebPage()
for sub_str in string:
print(sub_str)
d = jp.Div(text=sub_str)
d.on('click', my_click)
wp.add(d)
return wp
jp.justpy(hello_world)
I comes out as:
JustPy
I was clicked!
Introduction
I was clicked!
Under the Hood
News and Updates
License
Tutorial
Getting Started
Basic Concepts
Handling Events
HTML Components
The text was updated successfully, but these errors were encountered: