Giter VIP home page Giter VIP logo

Comments (1)

delucis avatar delucis commented on June 9, 2024

Thanks for the issue and the clear reproduction @Faf4a — I can confirm this is a bug. I’m not sure we ever considered nested asides when writing this code, but we should try to fix this.

For anyone interested in trying to fix this, the ::: directive asides are powered by a custom remark plugin.

My guess is this logic is what is buggy:

// remark-directive converts a container’s “label” to a paragraph in
// its children, but we want to pass it as the title prop to <Aside>, so
// we iterate over the children, find a directive label, store it for the
// title prop, and remove the paragraph from children.
let title = t(`aside.${variant}`);
remove(node, (child): boolean | void => {
if (child.data && 'directiveLabel' in child.data && child.data.directiveLabel) {
if (
'children' in child &&
Array.isArray(child.children) &&
'value' in child.children[0]
) {
title = child.children[0].value;
}
return true;
}
});

We also have tests for the remark plugin, so writing a new test for this case would be a good way to check a solution is working.

from starlight.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.