Skip to content

Style images inside documentation #992

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

Merged
merged 1 commit into from
Sep 23, 2022
Merged

Conversation

microbit-robert
Copy link
Collaborator

No description provided.

@github-actions
Copy link

Preview build will be at
https://review-python-editor-v3.microbit.org/doc-images/

const dimensionsArr = imageRef.match(/\d+x\d+/g);
if (!dimensionsArr) {
return undefined;
}
const dimensions = dimensionsArr.join().split("x");
const [width, height] = dimensions.map((n: string) => Number(n));
return width / height;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This number was being interpreted as a pixel value which is invalid CSS. Returning a string fixes this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd noticed this wasn't working well but hadn't looked again at the code. Thanks.

@microbit-robert microbit-robert marked this pull request as ready for review September 23, 2022 08:04
@microbit-matt-hillsdon microbit-matt-hillsdon merged commit 664be7e into main Sep 23, 2022
@microbit-matt-hillsdon microbit-matt-hillsdon deleted the doc-images branch September 23, 2022 12:19
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.

2 participants