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

Add support for subscript and superscript #57

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

katiefenn
Copy link

@katiefenn katiefenn commented Dec 3, 2024

  • The Spark team are working on a piece of work to add support to subscript and superscript to Spark
  • This commit contains changes to Content Tree to add support for subscript and superscript text, via the <sup> and <sub> tags

@katiefenn katiefenn force-pushed the add-subscript-and-superscript-support branch from 4cc1e8d to fbbf27f Compare December 5, 2024 14:21
```

**Superscript** represents a piece of text with a raised baseline.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

☝️ Add support for new subscript (<sub>) and superscript (<sup>) formatted text to Content Tree.

- The Spark team are working on a piece of work to add support to
  subscript and superscript to Spark
- This commit contains changes to Content Tree to add support for
  subscript and superscript text, via the <sup> and <sub> tags
@katiefenn katiefenn force-pushed the add-subscript-and-superscript-support branch from fbbf27f to fd3c12d Compare December 5, 2024 16:07
"value": " The English Stage Company at the Royal Court Theatre, headed by George Devine and Theatre Workshop organised by Joan Littlewood were particularly prominent in bringing these plays to public attention. Critic John Heilpern wrote that Look Back in Anger expressed such “immensity of feeling and class hatred” that it altered the course of English theatre. The term “Angry theatre” was coined by critic John Russell Taylor."
}
]
},
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

☝️ Add some test data for superscript text. 👇

interface Superscript extends Parent {
type: "superscript";
children: Phrasing[];
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

☝️ All changes in this file are autogenerated from changes to README.md.

@katiefenn katiefenn marked this pull request as ready for review December 5, 2024 16:26
@katiefenn katiefenn requested review from chee and a team as code owners December 5, 2024 16:26
@adgad adgad requested a review from a team December 5, 2024 16:53
Copy link
Contributor

@epavlova epavlova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: On a note separate from this pr, the body xml should support subscript and superscript so there may be work in C&M related this.

@@ -283,6 +283,28 @@ interface Strikethrough extends Parent {

**Strikethrough** represents a piece of text that has been stricken.

### `Subscript`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: If I'm not mistaken the json schemas will need to be updated.
For context, the C&M team will allow publishing of content tree next year and those schemas will be our source of truth for validation.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSON schemas get automatically generated as part of the build step

I think what's missing (and why the JSON schemas haven't been updated yet) is that the new types need to be included as things that can be "Phrasing" - https://github.com/Financial-Times/content-tree/pull/57/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R130

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just added Subscript and Superscript to the Phrasing types, and re-built the schema 👍

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 this pull request may close these issues.

4 participants