How to stop Wordpress.com from removing whitespace when copying?

I am trying to publish my post on Wordpress.com.

I want to include console output Rin a message. The output is as follows:

age weight height      bmi waist_circ hip_circ waist_hip_ratio glucose cholesterol_total triglycerides hdl ldl insulin      homa ldl_by_hdl fat_pct
1  30     65    163 24.46460         80      100       0.8000000      70               198            66  58 127     4.9 0.8469136  2.1896552    28.6
2  29     54    165 19.83471         69       98       0.7040816      94               223            69  60 149     4.7 1.0908642  2.4833333    27.7
3  29     66    163 24.84098         83      100       0.8300000      79               130            61  60  58     4.1 0.7997531  0.9666667    34.7
4  29     55    163 20.70082         68      104       0.6538462      71               155            36  83  65     7.8 1.3674074  0.7831325    28.1
5  29     63    167 22.58955         70       98       0.7142857      79               183            63  52 118     5.4 1.0533333  2.2692308    29.2
6  27     63    172 21.29529         75      103       0.7281553      74               172            85  64  91     4.2 0.7674074  1.4218750    24.3

I'm working on OS X. When I copy the contents above into a TextEdit application, I can clearly see that there are several spaces between some values ​​so that this table looks like column-adjusted, just like in the fragment above. (For example, in the second line there are 7 spaces between 69and 98).

When I make a simple copy-paste ( command+ c, command+ v) in Wordpress.com. Editing a section of a message, it reduces the number of spaces by 1 space (undesirable), regardless of whether I insert in the paragraph or code area. This leads to the fact that the output signal is not supported, for example:

 age weight height bmi waist_circ hip_circ waist_hip_ratio glucose cholesterol_total triglycerides hdl ldl insulin homa ldl_by_hdl fat_pct
1 30 65 163 24.46460 80 100 0.8000000 70 198 66 58 127 4.9 0.8469136 2.1896552 28.6
2 29 54 165 19.83471 69 98 0.7040816 94 223 69 60 149 4.7 1.0908642 2.4833333 27.7
3 29 66 163 24.84098 83 100 0.8300000 79 130 61 60 58 4.1 0.7997531 0.9666667 34.7
4 29 55 163 20.70082 68 104 0.6538462 71 155 36 83 65 7.8 1.3674074 0.7831325 28.1
5 29 63 167 22.58955 70 98 0.7142857 79 183 63 52 118 5.4 1.0533333 2.2692308 29.2
6 27 63 172 21.29529 75 103 0.7281553 74 172 85 64 91 4.2 0.7674074 1.4218750 24.3

Q: How can I prevent Wordpress.com from removing these spaces?

+4
source share
2 answers

You can use shortcodes WP.com offers , in this case or . [code][sourcecode]

It is important to paste the code into HTML editing mode :

[code language="r"]
age weight height      bmi waist_circ hip_circ waist_hip_ratio glucose cholesterol_total triglycerides hdl ldl insulin      homa ldl_by_hdl fat_pct
1  30     65    163 24.46460         80      100       0.8000000      70               198            66  58 127     4.9 0.8469136  2.1896552    28.6
2  29     54    165 19.83471         69       98       0.7040816      94               223            69  60 149     4.7 1.0908642  2.4833333    27.7
3  29     66    163 24.84098         83      100       0.8300000      79               130            61  60  58     4.1 0.7997531  0.9666667    34.7
4  29     55    163 20.70082         68      104       0.6538462      71               155            36  83  65     7.8 1.3674074  0.7831325    28.1
5  29     63    167 22.58955         70       98       0.7142857      79               183            63  52 118     5.4 1.0533333  2.2692308    29.2
6  27     63    172 21.29529         75      103       0.7281553      74               172            85  64  91     4.2 0.7674074  1.4218750    24.3
[/code]

Results in:


qeqdO.png

+1

, R,  , HTML, , Wordpress HTML.

Wordpress  , , R.

, CSS . <div>, CSS white-space:

<html>
<head>
<style>
div.rdata {
    white-space: pre;
} 
</style>
</head>

<div>, R:

<div class="rdata">
    age weight height      bmi waist_circ hip_circ waist_hip_ratio glucose cholesterol_total triglycerides hdl ldl insulin      homa ldl_by_hdl fat_pct
    1  30     65    163 24.46460         80      100       0.8000000      70               198            66  58 127     4.9 0.8469136  2.1896552    28.6
    ...

</div>

, , , , Courier, , .

+1

Source: https://habr.com/ru/post/1624724/


All Articles