Spaces In Code Being Formatted

Why do we now get spaces formatted out of our code when we paste it into the forum.

Note, that this only seems to happen when I copy and paste code from Microsoft Word, so it might just be an issue with Microsoft Office.

If I copy and paste from a simple text document or from a QuarkXPress file or a Adobe Indesign file, then it doesn’t format the spaces, although I would never use Quark or InDesign for code samples etc.

Like this for example…

  1. import wixCRM from ‘wix-crm’;

  2. $w.onReady( function () {

  3. $w(" #PublicContactUs ").onAfterSave(() => {

  4. let name = $w(’ #publiccontactName ').value;

  5. let email = $w(" #publiccontactEmail ").value;

  6. let subject = $w(" #publiccontactSubject ").value;

  7. let message = $w(" #publiccontactMessage ").value;

  8. let label = [“Contacted Us”];

importwixCRM from 'wix-crm';

$w.onReady(function() {
$w("#PublicContactUs").onAfterSave(() => {
letname = $w('#publiccontactName').value;
letemail = $w("#publiccontactEmail").value;
letsubject = $w("#publiccontactSubject").value;
letmessage = $w("#publiccontactMessage").value;
letlabel = ["Contacted Us"];

When it should be like this…

  1. import wixCRM from ‘wix-crm’;

  2. $w.onReady(function() {

  3. $w(“#PublicContactUs”).onAfterSave(() => {

  4. let name = $w(‘#publiccontactName’).value;

  5. let email = $w(“#publiccontactEmail”).value;

  6. let subject = $w(“#publiccontactSubject”).value;

  7. let message = $w(“#publiccontactMessage”).value;

  8. let label = [“Contacted Us”];

import wixCRM from 'wix-crm';

$w.onReady(function() {
$w("#PublicContactUs").onAfterSave(() => {
let name = $w('#publiccontactName').value;
let email = $w("#publiccontactEmail").value;
let subject = $w("#publiccontactSubject").value;
let message = $w("#publiccontactMessage").value;
let label = ["Contacted Us"];

.docx format is probably the issue. Markdown editors work best for me - this one is awesome.