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

Use monospace font for <a>s that link back to IDL #1088

Closed
anssiko opened this issue Feb 16, 2017 · 5 comments · Fixed by #1095
Closed

Use monospace font for <a>s that link back to IDL #1088

anssiko opened this issue Feb 16, 2017 · 5 comments · Fixed by #1095

Comments

@anssiko
Copy link
Member

anssiko commented Feb 16, 2017

It'd be convenient if the <a>s in prose that link to IDL definitions would inherit the monospace font of the IDL block.

Given:

<section>
  <h2><dfn>Request</dfn> interface</h2>
  <pre class="idl">
    interface Request {};
  </pre>
  <p>An instance of <a>Request</a> allows you to make a request.</p>
</section>

(From: https://github.com/w3c/respec/wiki/WebIDL-Guide#defining-the-interface)

Expected rendering:

An instance of Request allows you to make a request.

Actual rendering:

An instance of Request allows you to make a request.

To get the expected result, one currently needs to e.g. wrap the <a>s in <code>, which seems redundant:

  <p>An instance of <code><a>Request</a></code> allows you to make a request.</a>

The established style is to use monospace font when referring to IDL definitions.

anssiko added a commit to w3c/html-media-capture that referenced this issue Feb 16, 2017
@marcoscaceres
Copy link
Member

marcoscaceres commented Feb 16, 2017

@anssiko, to get the behaviour you want, you need to change the section element to:

<section data-link-for="Request">

Duplicate of #1050

@anssiko
Copy link
Member Author

anssiko commented Feb 16, 2017

That appears not to work. What am I doing wrong?

Here's a minimal test case:

<!DOCTYPE html>
<html>
  <head>
    <meta charset='utf-8'>
    <title>Title</title>
    <script 
     src='https://www.w3.org/Tools/respec/respec-w3c-common' 
     class='remove'></script>
    <script class='remove'>
      var respecConfig = {
        specStatus: "ED",
        editors: [{
          name: "Your Name",
          url: "http://your-site.com",
        }],
        processVersion: 2015,
        edDraftURI: "http://some.github.repo",
        shortName: "dahut"
      };
    </script>
  </head>
  <body>
    <section data-link-for="Request">
      <h2><dfn>Request</dfn> interface</h2>
      <pre class="idl">
        interface Request {};
      </pre>
      <p>An instance of <a>Request</a> allows you to make a request.</p>
    </section>
  </body>
</html>

@marcoscaceres
Copy link
Member

d'oh. Something is not right... that should totally work.

@anssiko
Copy link
Member Author

anssiko commented Feb 17, 2017

Thanks! I'll owe you a 🍺

@marcoscaceres
Copy link
Member

Nah, the other way around. Need to investigate further - seems a set of commits have gone missing that caused this to regress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants