Tags:
create new tag
, view all tags

Feature Proposals » ENCODE to have newline parameter

Summary

Current State: Developer: Reason: Date: Concerns By: Bug Tracking: Proposed For:
MergedToCore HideyoImazu ConsensusReached 2014-03-25   TWikibug:Item7484 KampalaRelease

Edit Form

TopicSummary:
CurrentState:
CommittedDeveloper:
ReasonForDecision:
DateOfCommitment:   Format: YYYY-MM-DD
ConcernRaisedBy:
BugTracking:
OutstandingIssues:
RelatedTopics:
InterestedParties:
ProposedFor:
TWikiContributors:
 

Motivation

There are cases you want to replace a newline with <br/>. But %ENCODE{...}% cannot do it.

Description and Documentation

SEARCH{...}, FORMFIELD{...}%, and INCLUDE{...} variables have newline="..." parameter to replace newlines in the result with something else. For symmetricity, ENCODE{...} needs newline="..." too.

At first, I thought to introduce a new encode type nl2br and make it available to both SEARCH{...} and ENCODE{...}. Then PeterThoeny pointed out SEARCH{...} has newline="..." already and then I realized that INCLUDE{...} and FORMFIELD{...} have it too.

Examples

%ENCODE{"..." type="entity" newline="$br"}%

Impact

Implementation

-- Contributors: Hideyo Imazu - 2014-03-25

Discussion

This is a minor "no-brainer" enhancement that could be done without a feature proposal. As for token name, n2br might be better to align with \n and $n used elsewhere.

Having said that, the SEARCH already has a newline="%BR%" parameter. Does that address your need?

-- Peter Thoeny - 2014-03-25

I forgot about newline="%BR%" parameter of SEARCH{...}, which satisfies my immediate need.

SEARCH's newline is not only for $text but also for $pattern(...) and $formfield(...) so the newline parameter is to stay. So I started thinking to introduce the newline="..." parameter to ENCODE{...}. What do you think?

-- Hideyo Imazu - 2014-03-27

When keeping this proposal think it is better to have an ENCODE type="n2br" as you initially suggested instead of a newline="..." parameter to ENCODE, because the new encoding type will be available automatically in ENCODE, FORMFIELD, $formfield(), etc.

-- Peter Thoeny - 2014-03-27

As per our conversation in the previous release meeting, I've renamed this topic and updated the proposal accordingly.

-- Hideyo Imazu - 2014-04-10

Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2014-05-07 - HideyoImazu
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.