Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanBaulch committed Nov 22, 2024
1 parent c372b36 commit abbdd07
Show file tree
Hide file tree
Showing 23 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**

- SVGO Version [e.g. 3.3.2]
- NodeJs Version [e.g 16.16.0]
- Node.js Version [e.g 16.16.0]
- OS: [e.g. iOS]

**Additional context**
Expand Down
4 changes: 2 additions & 2 deletions docs/02-usage/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ We officially support four interfaces for SVGO:

## Community

Thanks to the community who have integrated, wrapped, or otherwise adapated SVGO to play well with other tools, and ultimately made SVGO more accessible for everyone.
Thanks to the community who have integrated, wrapped, or otherwise adapted SVGO to play well with other tools, and ultimately made SVGO more accessible for everyone.

This section showcases reputable projects that are stable and well maintained. Please check the project's website for more information on how to use it.

### Integrations

Depending on your project stack, you may want to try one of these integrations to seemlessly incorporate SVGO into your workflow:
Depending on your project stack, you may want to try one of these integrations to seamlessly incorporate SVGO into your workflow:

- [SVGR](https://react-svgr.com/) - Webpack loader that optimizes and transforms SVGs into React components.
- [grunt-svgmin](https://www.npmjs.com/package/grunt-svgmin) - Grunt task to optimize SVGs.
Expand Down
2 changes: 1 addition & 1 deletion docs/04-plugins/cleanupIds.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ svgo:
defaultPlugin: true
---

Removes unused IDs, and minifys IDs that are referenced by other elements.
Removes unused IDs, and minifies IDs that are referenced by other elements.

By default, we back off from removing and minifying IDs if a `<script>` or `<style>` element is present in the document. You can bypass this behavior by setting the `force` parameter to `true`.

Expand Down
2 changes: 1 addition & 1 deletion docs/04-plugins/convertOneStopGradients.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ svgo:

Converts the [`<linearGradient>`](https://developer.mozilla.org/docs/Web/SVG/Element/linearGradient) and [`<radialGradient>`](https://developer.mozilla.org/docs/Web/SVG/Element/radialGradient) nodes that are effectively a solid color to the color.

These nodes contain [`<stop>`](https://developer.mozilla.org/docs/Web/SVG/Element/stop) elements, which represent various colors to transition between. However, if a gradient only contains a single `<stop>`, then it's effecitively a solid fill.
These nodes contain [`<stop>`](https://developer.mozilla.org/docs/Web/SVG/Element/stop) elements, which represent various colors to transition between. However, if a gradient only contains a single `<stop>`, then it's effectively a solid fill.

Definitions of the gradients are removed, and the parent [`<defs>`](https://developer.mozilla.org/docs/Web/SVG/Element/defs) node is removed if it has no children after optimization. The `xlink:href` namespace is also removed if there are no remaining elements using this attribute.
2 changes: 1 addition & 1 deletion docs/04-plugins/convertStyleToAttrs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ svgo:
default: false
---

Converts [presentation attributes](https://developer.mozilla.org/docs/Web/SVG/Attribute/Presentation) in element styles to the equvilent XML attribute.
Converts [presentation attributes](https://developer.mozilla.org/docs/Web/SVG/Attribute/Presentation) in element styles to the equivalent XML attribute.

Presentation attributes can be used in both attributes and styles, but in most cases it'll take fewer bytes to use attributes. Consider the following:

Expand Down
2 changes: 1 addition & 1 deletion docs/04-plugins/prefixIds.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = {
};
```

However, a solution like this can not gurantee a reproducible prefix. Unpredictable IDs can pose an issue for tooling, namely React, and anything that depends on it like Next.js and Docusaurus.
However, a solution like this can not guarantee a reproducible prefix. Unpredictable IDs can pose an issue for tooling, namely React, and anything that depends on it like Next.js and Docusaurus.

With unpredictable IDs, if you're prerendering or use SSR (Server-Side Rendering), the client-side and server-side HTML may mismatch, leading to errors on client-side and regenerating the tree.

Expand Down
2 changes: 1 addition & 1 deletion docs/04-plugins/removeEditorsNSData.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ This plugin is completely safe to use before redistributing your SVG or incorpor

The kinds of elements that are removed are usually editor specific workspace settings. You should keep a backup of your original SVG to preserve that meta-data and continue to maintain your SVG, while you serve the optimized version to users.

You can find a list of removed editor namespaces in [`_collections.js`](https://github.com/search?q=repo%3Asvg%2Fsvgo+editorNamespaces&type=code), which includes software like [Inkscape](https://inkscape.org/), Adobe Illustator, and Figma.
You can find a list of removed editor namespaces in [`_collections.js`](https://github.com/search?q=repo%3Asvg%2Fsvgo+editorNamespaces&type=code), which includes software like [Inkscape](https://inkscape.org/), Adobe Illustrator, and Figma.
2 changes: 1 addition & 1 deletion docs/04-plugins/sortAttrs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ svgo:
- 'd'
- 'points'
xmlnsOrder:
description: Set to `'front'` if XML namespaces should be placed infront of all other attributes.
description: Set to `'front'` if XML namespaces should be placed in front of all other attributes.
default: 'front'
---

Expand Down
2 changes: 1 addition & 1 deletion lib/svgo.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export type Output = {
export declare const _collections: {
elemsGroups: Readonly<Record<string, Set<string>>>;
/**
* Elements where adding or removing whitespace may effect rendering, metadata,
* Elements where adding or removing whitespace may affect rendering, metadata,
* or semantic meaning.
*
* @see https://developer.mozilla.org/docs/Web/HTML/Element/pre
Expand Down
2 changes: 1 addition & 1 deletion lib/xast.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const visit = (node, visitor, parentNode) => {
}
// visit root children
if (node.type === 'root') {
// copy children array to not loose cursor when children is spliced
// copy children array to not lose cursor when children is spliced
for (const child of node.children) {
visit(child, visitor, node);
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/_path.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ function gatherPoints(pathData) {

case 'C':
if (basePoint != null) {
// Approximate quibic Bezier curve with middle points between control points
// Approximate cubic Bezier curve with middle points between control points
addPoint(subPath, [
0.5 * (basePoint[0] + data[0]),
0.5 * (basePoint[1] + data[1]),
Expand Down
2 changes: 1 addition & 1 deletion plugins/_transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ const transformToMatrix = (transform) => {
* Applies transformation to an arc. To do so, we represent ellipse as a matrix, multiply it
* by the transformation matrix and use a singular value decomposition to represent in a form
* rotate(θ)·scale(a b)·rotate(φ). This gives us new ellipse params a, b and θ.
* SVD is being done with the formulae provided by Wolffram|Alpha (svd {{m0, m2}, {m1, m3}})
* SVD is being done with the formulae provided by Wolfram|Alpha (svd {{m0, m2}, {m1, m3}})
*
* @type {(
* cursor: [x: number, y: number],
Expand Down
2 changes: 1 addition & 1 deletion plugins/cleanupEnableBackground.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export const fn = (root) => {
};

/**
* @param {string} value Value of a enable-background attribute or style declaration.
* @param {string} value Value of an enable-background attribute or style declaration.
* @param {string} nodeName Name of the node the value was assigned to.
* @param {string} width Width of the node the value was assigned to.
* @param {string} height Height of the node the value was assigned to.
Expand Down
2 changes: 1 addition & 1 deletion plugins/convertTransform.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ const definePrecision = (data, { ...newParams }) => {
),
);
}
// No sense in angle precision more then number of significant digits in matrix.
// No sense in angle precision more than number of significant digits in matrix.
if (newParams.degPrecision == null) {
newParams.degPrecision = Math.max(
0,
Expand Down
2 changes: 1 addition & 1 deletion plugins/minifyStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const fn = (_root, { usage, ...params }) => {

/**
* Force to use usage data even if it unsafe. For example, the document
* contains scripts or in attributes..
* contains scripts or in attributes.
*/
let forceUsageDeoptimized = false;

Expand Down
2 changes: 1 addition & 1 deletion plugins/moveElemsAttrsToGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const fn = (root) => {
return {
element: {
exit: (node) => {
// process only groups with more than 1 children
// process only groups with more than 1 child
if (node.name !== 'g' || node.children.length <= 1) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/plugins-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ type DefaultPlugins = {
useMqs?: string[];
/**
* Pseudo-classes and elements to use. An empty string indicates all
* all non-pseudo-classes and elements.
* are non-pseudo-classes and elements.
*/
usePseudos?: string[];
};
Expand Down
4 changes: 2 additions & 2 deletions plugins/removeAttrs.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ export const fn = (root, params) => {
element: {
enter: (node) => {
for (let pattern of attrs) {
// if no element separators (:), assume it's attribute name, and apply to all elements *regardless of value*
// if no element separators (:), assume its attribute name, and apply to all elements *regardless of value*
if (!pattern.includes(elemSeparator)) {
pattern = ['.*', pattern, '.*'].join(elemSeparator);
// if only 1 separator, assume it's element and attribute name, and apply regardless of attribute value
// if only 1 separator, assume its element and attribute name, and apply regardless of attribute value
} else if (pattern.split(elemSeparator).length < 3) {
pattern = [pattern, '.*'].join(elemSeparator);
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/removeOffCanvasPaths.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const fn = () => {
) {
const pathData = parsePathData(node.attributes.d);

// consider that a M command within the viewBox is visible
// consider that an M command within the viewBox is visible
let visible = false;
for (const pathDataItem of pathData) {
if (pathDataItem.command === 'M') {
Expand Down
2 changes: 1 addition & 1 deletion test/plugins/cleanupIds.23.svg.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
When there is an malformed reference that points to a non-existent node, skip
When there is a malformed reference that points to a non-existent node, skip
that ID if the ID is generated by the plugin.

See: https://github.com/svg/svgo/issues/1815
Expand Down
2 changes: 1 addition & 1 deletion test/plugins/convertOneStopGradients.03.svg.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
If a one-stop gradient has the color defined via both attribute and style, style
takes presedence.
takes precedence.

===

Expand Down
2 changes: 1 addition & 1 deletion test/plugins/mergePaths.07.svg.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Merged paths loose their ends and markers are rendered incorrectly
Merged paths lose their ends and markers are rendered incorrectly

===

Expand Down
2 changes: 1 addition & 1 deletion test/plugins/reusePaths.06.svg.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Don't remove and reuse the ID of the duplicate path if it's already being linked
in an href by another node.
in a href by another node.

===

Expand Down

0 comments on commit abbdd07

Please sign in to comment.