question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Disable `cs:text` attributes for macros?

See original GitHub issue

This thread on pandoc-discuss mentions that the spec is currently not clear about rules of precedence in cases such as this one:

<macro name="title">
  <text variable="title" text-case="lowercase"/>
</macro>
...
<bibliography>
  <text macro="title" text-case="title"/>
</bibliography>

What should happen in this case? I’d say the attribute on the lowest level should override the attribute on higher level.

Generally, I’m not sure allowing all cs:text attributes for macros makes a ton of sense. Affixes ok, but the rest? I’d assume that format attributes should be set on the lower level, i.e., inside cs:macro on cs:text, but not when a macro gets called. Format attributes on a macro call runs somewhat against the idea of macros, or am I missing something?

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
denismaiercommented, May 25, 2022

FWIW, I think the right logic within CSL is to have the lowest level element determine formatting: that’s how rules for attributes on names work: setting them on names takes precedence over setting them on citation, which takes precedent over those set on style.

Yes, that was my initial impulse again. But while the specification is explicit about name attributes, the expected behaviour for other attributes is not specified.

One question I have about removing the option to style macros is how this affects formatting of affixes: <text macro="title" font-weight="bold" suffix="."/> would bold the period.

That’s a good point. I still think styling should be done in macro calls, but rather inside macros, but this is of course a valid concern.

What about this then: Let’s just make this explicit in the specification?

0reactions
denismaiercommented, May 28, 2022

A couple of examples:

<macro name="title">
  <text variable="title" font-style="italic"/>
</macro>
<bibliography>
  <text macro="title"/>
</bibliography>

=> title rendered using italics.

<macro name="title">
  <text variable="title" font-style="italic"/>
</macro>
<bibliography>
  <text macro="title" font-style="italic"/>
</bibliography>

=> italic.

<macro name="title">
  <text variable="title" font-style="italic"/>
</macro>
<bibliography>
  <text macro="title" font-style="normal"/>
</bibliography>

=> italic

<macro name="title">
  <text variable="title" font-style="normal"/>
</macro>
<bibliography>
  <text macro="title" font-style="italic"/>
</bibliography>

=> normal

<macro name="title">
  <text variable="title"/>
</macro>
<bibliography>
  <text macro="title" font-style="italic"/>
</bibliography>

=> italic

@bwiernik Is that what you’ve meant with:

So, font formatting on text macro overrides any lower, but only if specified?

Read more comments on GitHub >

github_iconTop Results From Across the Web

disabled - CSS: Cascading Style Sheets - MDN Web Docs
The :disabled CSS pseudo-class represents any disabled element. An element is disabled if it can't be activated (selected, clicked on, ...
Read more >
Enable or Disable built-in macros - HCL Product Documentation
This section covers enabling or disabling the Tiny Editors built-in macros: useful text styling macros. Procedure. Using a plain text editor, open config/config ......
Read more >
Disable confluence elements (or set CSS on certain elements ...
Problem. Confluence allows public (anonymous) viewing/access to spaces and pages. For various reasons one might want to disable various ...
Read more >
How do I disable form fields using CSS? - html - Stack Overflow
To actually disable your fields, you must use the disabled attribute in HTML or the disabled DOM property in JavaScript.
Read more >
Macro – Remove comments (css html javascript c++ java c ...
1> Copy to your Emeditor Macros directory. 2> Macros -> Customize -> New -> DCMT.js 3> Enjoy the decomment fun! feature:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found