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

docs: Fix a few typos #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ new_form = <form action="/submit" method="POST">{old_form.children("input")}</fo

### Attributes

You can access any attribute of a tag as a member variable on the tag, or via the `attr(attr_name)` function. Setting attribute must happen via the `set_attr(attr_name, attr_value)` function i.e. do not set attrs by directly setting member variables. To access attributes that contain '-' (hypen) as a member variable, replace the hypen with '_' (underscore). For this reason, pyxl does not allow attributes with an underscore in their name. Here is an example that demonstrates all these principles:
You can access any attribute of a tag as a member variable on the tag, or via the `attr(attr_name)` function. Setting attribute must happen via the `set_attr(attr_name, attr_value)` function i.e. do not set attrs by directly setting member variables. To access attributes that contain '-' (hyphen) as a member variable, replace the hyphen with '_' (underscore). For this reason, pyxl does not allow attributes with an underscore in their name. Here is an example that demonstrates all these principles:

```py
fruit = <div data-text="tangerine" />
Expand Down
4 changes: 2 additions & 2 deletions pyxl/codec/pytokenize.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def untokenize(iterable):
Round-trip invariant for full input:
Untokenized source will match input source exactly

Round-trip invariant for limited intput:
Round-trip invariant for limited input:
# Output text will tokenize the back to the input
t1 = [tok[:2] for tok in generate_tokens(f.readline)]
newcode = untokenize(t1)
Expand All @@ -296,7 +296,7 @@ def untokenize(iterable):

def generate_tokens(readline):
"""
The generate_tokens() generator requires one argment, readline, which
The generate_tokens() generator requires one argument, readline, which
must be a callable object which provides the same interface as the
readline() method of built-in file objects. Each call to the function
should return one line of input as a string. Alternately, readline
Expand Down
2 changes: 1 addition & 1 deletion tests/test_whitespace_11.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from pyxl import html

def test():
# Presence of paretheses around html should not affect contents of tags. (In old pyxl,
# Presence of parentheses around html should not affect contents of tags. (In old pyxl,
# this led to differences in whitespace handling.)
assert str(get_frag1()) == str(get_frag2())

Expand Down