Skip to content

Commit

Permalink
use "<a></a>Content" instead of "<a>Content</a>" (#818)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbhmr authored Jan 16, 2024
1 parent 3433f2d commit 7c9c462
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions crates/markdown/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl WorldGenerator for Markdown {
let name = resolve.name_world_key(name);
uwriteln!(
self.src,
"## <a name=\"{}\">Import interface {name}</a>\n",
"## <a name=\"{}\"></a>Import interface {name}\n",
name.to_snake_case()
);
self.hrefs
Expand Down Expand Up @@ -158,7 +158,7 @@ impl WorldGenerator for Markdown {
let name = resolve.name_world_key(name);
uwriteln!(
self.src,
"## <a name=\"{}\">Export interface {name}</a>\n",
"## <a name=\"{}\"></a>Export interface {name}\n",
name.to_snake_case()
);
self.hrefs
Expand Down Expand Up @@ -261,14 +261,14 @@ impl InterfaceGenerator<'_> {

fn func(&mut self, func: &Function) {
self.push_str(&format!(
"#### <a name=\"{0}\">`",
"#### <a name=\"{0}\"></a>`",
func.name.to_snake_case()
));
self.gen
.hrefs
.insert(func.name.clone(), format!("#{}", func.name.to_snake_case()));
self.push_str(&func.name);
self.push_str(": func`</a>");
self.push_str(": func`");
self.push_str("\n\n");
self.docs(&func.docs);

Expand All @@ -277,7 +277,7 @@ impl InterfaceGenerator<'_> {
self.push_str("##### Params\n\n");
for (name, ty) in func.params.iter() {
self.push_str(&format!(
"- <a name=\"{f}.{p}\">`{}`</a>: ",
"- <a name=\"{f}.{p}\"></a>`{}`: ",
name,
f = func.name.to_snake_case(),
p = name.to_snake_case(),
Expand All @@ -293,7 +293,7 @@ impl InterfaceGenerator<'_> {
Results::Named(params) => {
for (name, ty) in params.iter() {
self.push_str(&format!(
"- <a name=\"{f}.{p}\">`{}`</a>: ",
"- <a name=\"{f}.{p}\"></a>`{}`: ",
name,
f = func.name.to_snake_case(),
p = name,
Expand Down Expand Up @@ -465,7 +465,7 @@ impl InterfaceGenerator<'_> {
self.types_header_printed = true;
}
self.push_str(&format!(
"#### <a name=\"{}\">`{} {}`</a>\n",
"#### <a name=\"{}\"></a>`{} {}`\n",
name.to_snake_case(),
type_,
name,
Expand All @@ -488,7 +488,7 @@ impl<'a> wit_bindgen_core::InterfaceGenerator<'a> for InterfaceGenerator<'a> {
self.push_str("\n##### Record Fields\n\n");
for field in record.fields.iter() {
self.push_str(&format!(
"- <a name=\"{r}.{f}\">`{name}`</a>: ",
"- <a name=\"{r}.{f}\"></a>`{name}`: ",
r = name.to_snake_case(),
f = field.name.to_snake_case(),
name = field.name,
Expand Down Expand Up @@ -521,7 +521,7 @@ impl<'a> wit_bindgen_core::InterfaceGenerator<'a> for InterfaceGenerator<'a> {
self.push_str("\n##### Tuple Fields\n\n");
for (i, ty) in tuple.types.iter().enumerate() {
self.push_str(&format!(
"- <a name=\"{r}.{f}\">`{name}`</a>: ",
"- <a name=\"{r}.{f}\"></a>`{name}`: ",
r = name.to_snake_case(),
f = i,
name = i,
Expand All @@ -542,7 +542,7 @@ impl<'a> wit_bindgen_core::InterfaceGenerator<'a> for InterfaceGenerator<'a> {
self.push_str("\n##### Flags members\n\n");
for flag in flags.flags.iter() {
self.push_str(&format!(
"- <a name=\"{r}.{f}\">`{name}`</a>: ",
"- <a name=\"{r}.{f}\"></a>`{name}`: ",
r = name.to_snake_case(),
f = flag.name.to_snake_case(),
name = flag.name,
Expand All @@ -568,7 +568,7 @@ impl<'a> wit_bindgen_core::InterfaceGenerator<'a> for InterfaceGenerator<'a> {
self.push_str("\n##### Variant Cases\n\n");
for case in variant.cases.iter() {
self.push_str(&format!(
"- <a name=\"{v}.{c}\">`{name}`</a>",
"- <a name=\"{v}.{c}\"></a>`{name}`",
v = name.to_snake_case(),
c = case.name.to_snake_case(),
name = case.name,
Expand Down Expand Up @@ -598,7 +598,7 @@ impl<'a> wit_bindgen_core::InterfaceGenerator<'a> for InterfaceGenerator<'a> {
self.push_str("\n##### Enum Cases\n\n");
for case in enum_.cases.iter() {
self.push_str(&format!(
"- <a name=\"{v}.{c}\">`{name}`</a>",
"- <a name=\"{v}.{c}\"></a>`{name}`",
v = name.to_snake_case(),
c = case.name.to_snake_case(),
name = case.name,
Expand Down

0 comments on commit 7c9c462

Please sign in to comment.