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

Send CRLF to Windows UAs for code blocks #863 #872

Merged
merged 1 commit into from
Feb 11, 2015
Merged

Send CRLF to Windows UAs for code blocks #863 #872

merged 1 commit into from
Feb 11, 2015

Conversation

splitbrain
Copy link
Collaborator

issue #863

@scrutinizer-notifier
Copy link

The inspection completed: No new issues

@selfthinker
Copy link
Collaborator

So, you're assuming, just because someone uses Windows, he/she automatically would want to have Windows line endings in downloaded code snippets?

@splitbrain
Copy link
Collaborator Author

yes.

splitbrain added a commit that referenced this pull request Feb 11, 2015
Send CRLF to Windows UAs for code blocks #863
@splitbrain splitbrain merged commit 76ec6b0 into master Feb 11, 2015
@splitbrain splitbrain deleted the bug863 branch February 11, 2015 08:27
Hew-ux added a commit to Hew-ux/dokuwiki that referenced this pull request Dec 21, 2021
... 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants