Trello API: Programatically Adding Line Breaks to Card Descriptions - line-breaks

When manually entering a Trello card's description, it's easy to introduce line breaks: just press ENTER. However, I need to introduce line breaks when setting a card's description via the Trello API. So far, \n and < br > don't get parsed. Any ideas?

If you happen to find this and are looking to add a line break using the URL from the API, use %0A.
For example:
https://api.trello.com/1/cards?key=(key)&token=(token)&name=(card name)&desc=Line 1 %0A Line 2 %0A Line 3&idList=<id>

Struggled with this problem for ages.
The php in WisdmLabs' answer works if it's passed as php to an element and then to js through getElementByID, but that's not possible if you need to set the variable clientside.
Finally found \x0A works in js.
Hope this saves someone from the hours of googling I endured!

Hi I got the solution to add Line break in trello card description, if you are using php.
Try like this,
$card_desc = $some_text . "\xA" . $some_more_text;

I figured it out. I'm coming from .NET, so I used concatenation around Environment.NewLine calls to introduce new lines. Trello respected these as line breaks.

You can try with whatever works best in your current language.
So far, known working line breaks are:
PHP: PHP_EOL (= \n)
.NET: Environment.NewLine
JS: \x0A
URl linebreak: %0A

Here '\x0A' works in python very well.
So..
PHP: PHP_EOL (= \n)
.NET: Environment.NewLine
JS / PYTHON: \x0A
URl linebreak: %0A

Related

Vim. Use matchpairs option for jumping between start and end of spanish questions marks

Just as title says, I want matchpairs option to work with with the signs '¿' and '?'. It works with other signs, for example after setting:
I'm able to jump between spanish exclamation marks ('¡' and '!') with just pressing '%'. The problem comes when doing the same with questions marks by:'
I will obtain a error message explaining some kind of function failing dealing with regex:
At first sight, the function would seem to come from one of my plugins so I tried to find which by replacing my .vimrc with a blank file but vim continued showing the same error so my personal plugins are not the problem.
As far as I know, when using nocompatible mode in vim several integrated plugins are charged. I think some of those plugins is the guilty, because when I call vim without any config fail by "vim -u NONE" the problem disappears. However, anyone here would be with me in that using no config file would be a little unpleasant.
Then my questions are:
What is the easiest way to solve this problem?
What is causing it? Is really something related with regular expressions (I have tried placing a '\' before the '?' without results)'?
You could use matchit plugin (which most likely is already installed in your computer as the function causing the error, Match_wrapper(), is defined on matchit.vim. To check if matchit.vim is loaded, use the command :scriptnames in Vim). Then add this auto command to .vimrc:
autocmd! BufWinEnter,BufEnter * if exists("b:match_words") |
\ let b:match_words=b:match_words.',¿:?' |
\ endif
To keep .vimrc clean you may want to follow the advice on help :matchit:
... you can add autocommands to the script or to your vimrc file, but the recommended method is to add a line such as
let b:match_words = '\<foo\>:\<bar\>'
to the filetype-plugin for your language.

how to do vi search and replace within a range in sublime text

I enabled vintage mode on sublime text.. but there are some important vim commands that are lacking.. so let's say I want to do a search and replace like so
:10,25s/searchedText/toReplaceText/gc
so I wanna search searchedText and replace it with toReplaceText from lines 10 to 25 and be prompted every time (ie yes/no)..
how do I do this with Sublime Text? everytime I hit : it gives me this funny menu.. any way around that?
If you so much would like to see vim in action, try the other way around; ie enable sublime stuff in vim.
Here are 2 links that might come in handy:
subvim and vim multiple cursors (Which is one amazing feature in sublime that lacks in native vim).
Hope that gets you creative ;)
Unfortunately vintage mode does not understand ranges. The best way I know how to do this is with incremental search:
highlight the first occurrence of searchedText on line 10
hit cmnd/ctrl D to have Sublime find the next occurence
If you you want the next occurrence ignored, hit cmnd/ctrl K
Once you have highlighted all the occurrences, you can replace them all at once, as Sublime has left cursors behind on every occurrence you opted in on.
VintageEx gives you a Vim-like command-line where you can at least perform substitutions. Well, that's how far I went when trying it. I don't know how extended the subset of Vim commands it implements is but I'd guess that it's not as large as the original and, like with Vintage, probably different and unsettling enough to keep a relatively experienced Vimmer out.
Anyway, I just tried it again and indeed you can more or less do the kind of substitution you are looking for, which instantly makes ST a lot more useful:
:3,5s/foo/bar/g
:.,5s/bar/foo/g
:,5/foo/bar/g
:,+5/bar/foo/g
Unfortunately, it doesn't support the /c flag.
a plugin named vintageous offers more features including search function. It's available in package control
although this question is answered.. i figured this would add some value
the full functionality of vi search/replace is possible with the ruby mine IDE, once you install the ideavim plugin. The idea is perfect for ruby on rails by the way.

Using regex to eliminate chunks in a file (categorized events in iCal file)

I have one .ics file from which I would like to create individual new .ics files depending on the event categories (I can't get egroupware to export only events of one category, I want to create new calendars depending on category). My intended approach is to repeatedly eliminate all events but those of one category and then save the file using EditPad Lite 7 (Windows).
I am struggling to get the regular expression right. .+? is still too greedy and negating the string (e.g. to eliminate all but events from one category) doesn't work either.
Sample
BEGIN:VEVENT
DESCRIPTION:Event 2
END:VEVENT
BEGIN:VEVENT
DESCRIPTION:Event 3
CATEGORIES:Sports
END:VEVENT
BEGIN:VEVENT
DESCRIPTION:Event 4
END:VEVENT
The regex BEGIN:VEVENT.+?CATEGORIES:Sports.+?END:VEVENT should only match sports events but it catches everything from the first BEGINto the first ENDfollowing the category.
Edit: negating doesn't work either: BEGIN:VEVENT.+?((?!CATEGORIES:Sports).).+?END:VEVENT.
What am I missing? Any pointers are highly appreciated.
I guess newlines are removed or ignored, because your regex does not care about them.
I only have a correction to the match after CATEGORIES
BEGIN:VEVENT.+?CATEGORIES:Sports.*?END:VEVENT
^
Zero or more
The first part of your regex looks good, maybe the regex engine in EditPad is not so good.
Try it with a different editor or scripting language (like Eclipse or perl or Notepad+ or Notepad2)
You could split the input and then grep the matching Sports events
#sportevents = grep /Sports/, split /END:VEVENT/, $input
map $_.="END:VEVENT", #sportevents
This was perl, maybe you can launch a script from EditPad to do it.
The second line just restores the END:VEVENT that was stripped during split.
OK. Solved it. I found something here which can be used to split ics files. I tweaked it to use the category rather than the summary in the file name and then merged the individually generated files according to category. I added the usual ics header and footer to all files and, voilà, I had individual calendar files.

line break in google chart api

I am using google map chat api to create a image .I am generating following url
googlechartapi
This is the image i am getting.
But i want "by qwerty" in another line.
I tried to insert or | but it is not working.
Any idea how to do this?
You are looking for something like that I guess :
http://chart.apis.google.com/chart?chst=d_bubble_texts_big&chld=bb|ff0000|000000|hello+world|by+qwerty
Take a look at the multi-line bubble documentation.
The first line will be always larger, and it seems you can't do anything for that.
One or more lines of text, for multi-line text bubbles. Each line is separated by a | mark. The first line will be shown larger and boldface. Spaces must be replaced by +.
https://chart.googleapis.com/chart?chst=d_text_outline&chld=FFCC33|16|h|FF0000|b|Hello+world|by+qwerty
https://chart.googleapis.com/chart?chst=d_bubble_texts_big&chld=bb|FFB573|000000|Helo+world|by+qwerty
explanation:
https://developers.google.com/chart/image/docs/gallery/dynamic_icons?hl=pl-PL#single_line_outlined_text_icon
https://developers.google.com/chart/image/docs/gallery/dynamic_icons?hl=pl-PL#bubbles
?

Weird appearing for no reason

I've just launched my new site, and in going though it in multiple browsers to see how it performs, I've noticed something weird.
Can you see the gap after the word 'but'? By my reasoning, the word 'was' on the following line should be next to it, as there is plenty of space for it - but as you can see, it isn't.
Although this screenshot is from Firefox (10), I'm getting the same thing in Chrome (17) and Internet Explorer (9).
Using Firebug to inspect the element, it is showing a between the 'was' and 'disappointed' (which would explain why it isn't on the line above) - but upon viewing the source, no such exists.
This is leading me to suggest that the browser is inserting them - but I have no idea why.
Anyway, the page in question is http://limeblast.co.uk/2012/02/currently-playing/
I used wget to download the page directly to a file and I noticed that the space between was and 'disappointed' and all other spaces that you see as
are encoded with two bytes, C2 A0 hex, while the other spaces are encoded with one byte, 20hex.
Hope this helps.
Off-topic, I would also recommend justifying the text.
You should look into your colorbox implementation. It isn't working properly, and it's causing other issues on the page. I don't think it's necessarily related to what you're describing, but fix it, and you'll get your colorbox effect that you're after.
I took a look and tried a few things with your code, best solution I would recommend is to force your to be justified, right now your text is left aligned.
I had the same problem with text coming from the WP tinymce editor. This here solved it for me:
function b09_remove_forced_spaces($content) {
$string = htmlentities($content, null, 'utf-8');
$content = str_replace(" ", " ", $string);
$content = html_entity_decode($content);
return $content;
}
add_filter("the_content", "b09_remove_forced_spaces", 9);
based on https://stackoverflow.com/a/21801444/586823