Commit graph

348 commits

Author SHA1 Message Date
Chris Wong
616af0f4c0
Reduce duplication in Cargo.toml () 2024-03-10 13:52:51 +00:00
Chris Wong
9bba7d6390
Fix unused imports () 2024-03-10 13:43:23 +00:00
Chris Wong
6e50e675b6
Release 0.26.0 () 2024-01-15 23:21:00 +11:00
Chris Wong
26a9d7484d
Disallow int literals in attribute values () 2024-01-15 00:45:49 +11:00
Teodor Källman
b3a98c98d5
Parse many literals along side idents in names ()
* Parse many literals along side idents in names

* Accept ints as literals

We will not accept floats because `123.123` is a float literal,
but `123 .123` is a int literal followed by a class called `123`.
This could be confusing so it will not be accepted.

Ints can have leading zeros, like `0123`, but this is not guarranteed by
the rust compiler to always work, which could cause future errors.
An example would be truncating `001` to `1`.

* Limit accepted literals using existing function

* Update error output for non-string-literal

* Test output of ints with specified type

This outputs exactly what is written, which is the obvious behaviour

* Use nightly version to generate output

Previous verison was not using nightly, causing errors in the automated
test that are using nightly

* Replace "byte_string" with "raw_string" in test

---------

Co-authored-by: Chris Wong <lambda.fairy@gmail.com>
2024-01-04 15:32:25 +11:00
Soso
8318963db7
Upgrade to syn 2.0.0 ()
* Upgrade syn

* Disable proc-macro-error syn 1.0.0 dependency

* Update docs lockfile
2023-11-26 15:56:12 +11:00
Teodor Källman
8c47208568
Accept literals in attribute names ()
* Accept literals in attribute names

* Accept literals in attribute names

* Propper handling of literals in name_to_string()
2023-11-14 15:05:48 +11:00
Chris Wong
bfc3a6d0d5
Fix Clippy needless-raw-string-hashes warning () 2023-09-27 03:33:22 +00:00
Matt Fellenz
79259ab426
Fix ()
* Properly group splice expressions

* Add test for fix
2023-06-11 19:58:43 +10:00
Chris Wong
bf44196a61
Release 0.25.0 () 2023-04-16 16:54:45 +10:00
Simon Ask
6cdf12b427
Render with Display using autoref specialization () 2022-12-15 21:39:54 +11:00
Chris Wong
1fff8123eb
Remove html_debug! ()
It's not documented anywhere, and `cargo expand` does the same thing.
2022-10-27 04:29:04 +00:00
Chris Wong
8415003cc5
Release 0.24.0 ()
* Release 0.24.0

* Update Cargo.lock for docs
2022-09-25 23:48:38 +10:00
Chris Wong
c13e1dcc48
Don't symlink the escaper module ()
The symlink doesn't work on Windows, and breaks NixOS builds.

Closes 
2022-09-18 12:47:39 +00:00
Chris Wong
2f3d68c8a4
Remove blanket Render impl for T: Display ()
Closes 
2021-11-21 19:58:58 +11:00
Chris Wong
982c9f4a03
Release 0.23.0 () 2021-11-11 22:08:26 +11:00
Chris Wong
0d4276220d
Update slash error message to point to () 2021-11-07 12:31:46 +00:00
Chris Wong
dc6c88fae3
Disallow slashes (/) in void elements ()
# Overview

The following syntax will no longer work:

```rust
html! {
    br /
    link rel="stylesheet" href="styles.css" /
}
```

This should be changed to the following:

```rust
html! {
    br;
    link rel="stylesheet" href="styles.css";
}
```

# Rationale

The `;` syntax was introduced in ; the rationale for it can be found there.

Removing support for the older `/` syntax will simplify the API surface, and allow for the space to be used for other things.
2021-11-07 23:17:15 +11:00
Chris Wong
317bf9e5ec
Rename Attribute to NamedAttr () 2021-11-07 11:39:44 +00:00
Chris Wong
3c12d3639b
Simplify Generator::block () 2021-11-07 02:22:28 +00:00
Chris Wong
3232fb7eca
Delete maud_htmlescape package ()
Replace it with a symlink. Cargo will automatically resolve this to a
normal file on publish.
2021-11-06 11:33:44 +00:00
Chris Wong
49755007da
Update to Rust 2021 () 2021-11-01 17:18:48 +11:00
Alexandre Macabies
2909e5129c
Add support for Option<T> attributes ()
* Add support for Option<T> attributes

Introduces the `attr=[value]` syntax that assumes `value` is an
`Option<T>`. Renders `attr="value"` for `Some(value)` and entirely
omits the attribute for `None`.

Implements and therefore closes .

* Call `Generator::splice` directly

* Handle struct literals (edge case)

Co-authored-by: Chris Wong <xbuns@google.com>
2021-10-29 16:24:34 +11:00
GKnirps
df98f4f00b
Bump dependency proc-macro2 to 1.0.23 ()
- it won't build with 1.0.19
2021-09-28 22:41:20 +10:00
Chris Wong
2700f714bc
Release 0.22.3 () 2021-09-27 11:55:45 +00:00
Emilio González
4b317956fa
Report error for missing closing tag token () 2021-09-18 19:30:13 +10:00
Chris Wong
9a2c4fba4f
Fix Clippy warning () 2021-08-17 19:22:46 +10:00
Benjamin Halsted
3eb4254ffb
Using no_std + alloc ()
Removed references to `std` and replaced them with references to `core` and `alloc`.
Features `rocket` and `iron` still require `std`.

Co-authored-by: Chris Wong <lambda.fairy@gmail.com>
2021-07-30 22:05:31 +10:00
Chris Wong
8990049101
Improve error message for non-string literals ()
Closes 
2021-03-21 22:20:37 +11:00
Chris Wong
ce6458af41 Fix doc comments on parser 2021-03-13 20:49:05 +11:00
Chris Wong
9f7331f427
Remove Attrs type alias () 2021-03-13 20:25:56 +11:00
Chris Wong
b8872d4098
Don't call the user a "silly bumpkin" () 2021-01-09 18:51:05 +13:00
Chris Wong
87b7c9c2ba
Release 0.22.2 () 2021-01-09 18:01:17 +13:00
Chris Wong
b286c65939
Use Span::mixed_site directly from proc-macro2 ()
Since 1.0.19, `proc-macro2` now provides `Span::mixed_site` directly.
2021-01-09 17:15:43 +13:00
Chris Wong
5f7cec4da1
Remove Travis status badges ()
cc 
2020-12-23 19:38:27 +13:00
Chris Wong
d5dec51c3a
Make the ? suffix for empty attributes optional () 2020-11-11 16:47:23 +13:00
Chris Wong
0c9b6f2150
Release 0.22.1 ()
* Release 0.22.1

* Update benchmarks and docs dependencies

* Comrak breaking change
2020-11-02 19:24:13 +13:00
Chris Wong
49f3c46bd2
Avoid unstable specialization with this one weird trick! ()
Rustaceans hate him!
2020-10-05 22:44:27 +13:00
Chris Wong
d66c2d66fd
Remove #![feature(proc_macro_hygiene)] () 2020-09-27 23:17:41 +10:00
Chris Wong
50a7e9ce37 Format everything! 2020-09-27 21:36:27 +10:00
CreepySkeleton
4d3d057cc2 Move to trybuild 2020-08-31 11:57:57 +03:00
CreepySkeleton
3e23e0d784 Turn the warning into a hard error 2020-08-31 11:57:57 +03:00
CreepySkeleton
7b06af4369 Fix cargo clippy lints 2020-08-31 11:57:56 +03:00
CreepySkeleton
7d16af9a06 Make use of SpanRange instead of Span 2020-08-31 11:57:55 +03:00
CreepySkeleton
ef120ab2d0 Transfer codebase from ParseResult to abort! 2020-08-30 23:28:49 +03:00
Chris Wong
162a15ca83
Use std::matches! ()
* Use `std::matches!`

- Remove crates.io `matches` in favor of the `std` version

- Fix Clippy warning by changing a `match ... { ... }` to
  `matches!(...)`

* Satisfy `blocks_in_if_conditions`
2020-07-18 17:49:01 +10:00
Byte
a10130a9ac
Switch to 3rd party quote macro ()
* Add proc_macro2 and quote dependencies

* Completly switch over to proc_macro2 where possible

* Remove unessesary ::from casts

* Remove pendantic cast that i missed

* Make Builder::push_tokens accept TokenStream

* Remove stray commented out code

* Reword unclear comment on `Span` to a todo item

* Move comment closer to its intended line

* Use into instead of explicit conversion
2020-07-12 21:42:14 +10:00
Chris Wong
34a79ee706 Release 0.22 2020-06-20 19:57:51 +10:00
Byte
03e03e2e7d
Replace Span::def_site and remove #![feature(proc_macro_def_site)] () 2020-06-14 22:29:51 +10:00
AlterionX
42108c3517 Upgrade syn to 1.0.8. Upgrade matches to 0.1.8 2019-11-23 19:47:52 -06:00