[go: up one dir, main page]

Skip to content

Asciidoc - Files with CRLF line endings on targets when using the include directive do not show in the markup

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

Files with CRLF line endings on targets when using the include directive do not show in the markup.

Steps to reproduce

  1. Create a new repo
  2. Create a README.adoc file with the contents:
    == Version Information 1
    
    Version:
    include::version1.adoc[tag=version]
    
    == Version Information 2
    
    Version:
    include::version2.adoc[tag=version]
  3. Create a version1.adoc with the contents:
    // tag::version[]
    v1.0.0
    // end::version[]
  4. Create a version2.adoc with the contents:
    // tag::version[]
    v2.0.0
    // end::version[]
    1. However, ensure you save this file with CRLF (DOS) line endings. How you do this will depend on your editor. In Vim, you can save the file with CRLF line endings with the command :set ff=dos.
  5. Check that version1.adoc and version2.adoc have respective line endings for this test:
    $ file version1.adoc version2.adoc
    version1.adoc: ASCII text
    version2.adoc: ASCII text, with CRLF line terminators
  6. Push the repository to GitLab.
  7. Observe the markup README will only include the text from version1.adoc. (See screenshot below)

What is the current bug behavior?

Text with CRLF endings do not get shown in the asciidoc markup.

What is the expected correct behavior?

Text with CRLF endings do get shown in the asciidoc markup.

Relevant logs and/or screenshots

Screenshot image

Workaround.

  • Convert files to LF endings.
  • Configure Git on any Windows machines to use Unix based line endings, to prevent this from happening again. See the official git documentation here.

Possible fixes

Edited by 🤖 GitLab Bot 🤖