Skip to content

Partial escape of HTML link from peripheral description #849

Closed
@hegza

Description

@hegza

Given an SVD with an HTML link in a description creates either a correct or a partially escaped link definition depending on where it is generated in the PAC.

E.g., relevant part of input SVD:

<peripheral>
	<name>Google</name>
	<version>1.0</version>
	<description>
		Link to Google: &lt;https://google.com&gt;
	</description>
	<registers>...</registers>
</peripheral>

Relevant parts of output:

#[doc = "Link to Google: &lt;https://google.com>"]
pub mod google;
#[doc = "Link to Google: <https://google.com>"]
pub struct Google {
    _marker: PhantomData<*const ()>,
}

We see the generated link symbols are partially escaped when used in the mod documentation and correctly escaped when used in peripheral struct documentation.

Reproduction

  • Attached, minimal SVD to reproduce issue: test.zip (in Zip due to GitHub file-type restriction)
  • Command to generate: svd2rust --target riscv -i test.svd && form -i lib.rs -o src && rm lib.rs && cargo fmt
  • svd2rust --version

    svd2rust 0.33.3 ( )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions