{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreiertaglpn5mqrifkz4fzkoar2spb6njed5rrip3n3grv2gsvt2b5e",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mggqyexwlyj2"
},
"path": "/t/feature-request-proc-macro-with-content-as-string/24061#post_1",
"publishedAt": "2026-03-06T21:25:25.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "I wonder if Rust could eventually allow something like `#[proc_macro_string]` or `#[proc_macro_block]`. White space, en dash and other things makes things harder than needed when implementing a macro, at the moment. The idea is to take take the block as string and pass it to the macro.\n\nExample:\n\n\n #[proc_macro_block]\n\n pub fn html(input: &str) -> TokenStream {\n\n // process input block\n\n }\n\n\n\nUsage:\n\n\n let content = html! {\n\n <h1>The string to process</h1>\n\n };\n\n\n\nI can work on this. Would the change be accepted?",
"title": "Feature request: proc_macro with content as string"
}