Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add flag to specify which line feed to use #3567

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Dec 21, 2021

  1. add flag to specify which line feed to use

    ... for downloadable code blocks.
    
    This is more a feature request than it is a pull request, but I've done it like this to easily show/allow others to modify the code. Underneath my changes, at line 34, I've put in a commented out alternative version, primarily to demonstrate an alternative approach.
    
    I've been using Dokuwiki for a while to create and provide scripts for novice users to download and use for a small custom distribution based on Linux we are building that is typically deployed and edited on a remote network connection, using another computer to make those edits. This all works wonderfully well when downloading the files in a strictly Linux environment, however I've found out that users of Windows computers (which I've found out, is most of my reader's primary OS) were receiving these files with the incorrect CRLF line terminators. Looking through the web I found dokuwiki#863 , a change made around six years ago making DokuWiki automatically detect and change the line feed used in the downloaded file depending on the user's operating system. The actual commit merged that fixed it is dokuwiki#872 .
    
    This is a neat feature, and I wouldn't want to undo that behaviour by default, but I would like to add a flag that editors can use to specify "hey, this is a Unix script, and the linefeeds need to remain untouched", so that neophyte users can simply download and use the script files as they are without having to do additional line feed conversions.
    
    I'm aware that I'm changing the number of arguments that this function accepts, and that this would cause issues elsewhere, that's precisely why I'm asking for assistance here! I'm not a veteran DokuWiki coder, so please feel free to completely change this code, or close this pull request if it can be implemented in a much better way. The original PR I'm seeing that changed this behaviour in the first place only edited this file, so I'm not even sure where to begin looking for other files that might be calling this one, if there are any at all.
    Hew-ux committed Dec 21, 2021
    Configuration menu
    Copy the full SHA
    3d38090 View commit details
    Browse the repository at this point in the history
  2. added linefeed as an argument

    with a default value to avoid "not defined" situations
    Hew-ux committed Dec 21, 2021
    Configuration menu
    Copy the full SHA
    445319c View commit details
    Browse the repository at this point in the history