mirror of
https://github.com/mikefarah/yq.git
synced 2025-01-14 12:35:35 +00:00
v4.31.2
This commit is contained in:
parent
814a6114a8
commit
f6fad90a48
@ -407,8 +407,10 @@ A best attempt is made to copy comments to xml.
|
|||||||
|
|
||||||
Given a sample.yml file of:
|
Given a sample.yml file of:
|
||||||
```yaml
|
```yaml
|
||||||
|
#
|
||||||
# header comment
|
# header comment
|
||||||
# above_cat
|
# above_cat
|
||||||
|
#
|
||||||
cat: # inline_cat
|
cat: # inline_cat
|
||||||
# above_array
|
# above_array
|
||||||
array: # inline_array
|
array: # inline_array
|
||||||
@ -427,7 +429,9 @@ will output
|
|||||||
<!--
|
<!--
|
||||||
header comment
|
header comment
|
||||||
above_cat
|
above_cat
|
||||||
--><!-- inline_cat --><cat><!-- above_array inline_array -->
|
-->
|
||||||
|
<!-- inline_cat -->
|
||||||
|
<cat><!-- above_array inline_array -->
|
||||||
<array>val1<!-- inline_val1 --></array>
|
<array>val1<!-- inline_val1 --></array>
|
||||||
<array><!-- above_val2 -->val2<!-- inline_val2 --></array>
|
<array><!-- above_val2 -->val2<!-- inline_val2 --></array>
|
||||||
</cat><!-- below_cat -->
|
</cat><!-- below_cat -->
|
||||||
@ -489,7 +493,8 @@ yq -p=xml -o=xml '.' sample.xml
|
|||||||
```
|
```
|
||||||
will output
|
will output
|
||||||
```xml
|
```xml
|
||||||
<!-- before cat --><cat><!-- in cat before -->
|
<!-- before cat -->
|
||||||
|
<cat><!-- in cat before -->
|
||||||
<x>3<!-- multi
|
<x>3<!-- multi
|
||||||
line comment
|
line comment
|
||||||
for x --></x><!-- before y -->
|
for x --></x><!-- before y -->
|
||||||
|
Loading…
Reference in New Issue
Block a user