Format Codepen Code #5332
Labels
P3 Triaged
Issue has been reviewed as part of legacy backlog grooming (project P3).
Triaged: v4
Triaged, to be implemented as part of Vanilla v4
The code that is sent to CodePen is not formatted by js-beautify like the code shown in our code snippets is.
We should more consistently apply this formatting so that the code is formatted in one place, and the formatting result is used by both the example code snippets and CodePen.
Context
Here's the code path that the (correctly formatted) code snippet code follows:
createPreCode
is called onhtmlSource
vanilla-framework/templates/static/js/example.js
Line 148 in 510f79d
createPreCode
callsformatSource
, which calls the relevant js-beautify formatter.vanilla-framework/templates/static/js/example.js
Lines 82 to 85 in 510f79d
Here's the code that is defining what is sent to CodePen:
vanilla-framework/templates/static/js/example.js
Lines 114 to 123 in 510f79d
We are using
htmlSource
, which is not formatted (it is later passed intocreatePreCode
as discussed above).Maybe we should format
htmlSource
,jsSource
, andcssSource
at their initialization, rather than doing it increatePreCode
.The text was updated successfully, but these errors were encountered: