File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,14 @@ export default async function ({ feature, console }) {
2323 return textWidth ;
2424 }
2525
26+ function clearCenterAlignment ( textarea ) {
27+ const lines = textarea . value . split ( "\n" ) ;
28+ const uncenteredLines = lines . map ( ( line ) => {
29+ return line . replace ( / ^ \s + / , "" ) ;
30+ } ) ;
31+ textarea . value = uncenteredLines . join ( "\n" ) ;
32+ }
33+
2634 function centerAlignText ( ) {
2735 const form = document . querySelector ( ".project-description-form" ) ;
2836 if ( form ) {
@@ -31,6 +39,8 @@ export default async function ({ feature, console }) {
3139 activeElement . tagName === "TEXTAREA" &&
3240 form . contains ( activeElement )
3341 ) {
42+ clearCenterAlignment ( activeElement ) ; // Clear any existing center alignment
43+
3444 const spaceWidth = getSpaceWidth ( ) ;
3545 const lines = activeElement . value . split ( "\n" ) ;
3646 const centeredLines = lines . map ( ( line ) => {
You can’t perform that action at this time.
0 commit comments