Return to Project-GC

Welcome to Project-GC Q&A. Ask questions and get answers from other Project-GC users.

If you get a good answer, click the checkbox on the left to select it as the best answer.

Upvote answers or questions that have helped you.

If you don't get clear answers, edit your question to make it clearer.

Converter to convert BBCode/HTML to Markdown in logs

+3 votes
1,540 views
As Groundspeak announced that it will switch the Markup-Code, in which logs has to be formatted, from BBCode/HTML to Markdown, a Tool would be helpful to convert old logs to new formatting - sure this could only be half-automated.

Maybe GS will add something like this but if not, this would be a nice feature to have on Project-GC.
asked Jan 27, 2016 in Feature requests by Cachologen (150 points)
edited Jan 27, 2016 by Cachologen
As it is not possible to edit logs with the API, you would still have to manually copy and paste the new text into each and every one of your logs. Not really doable if you have more than a few hundred finds.

2 Answers

0 votes
As thomfre commented. It's not possible to edit or delete logs using the API. Therefore it makes no sense, sadly.
answered Jan 27, 2016 by magma1447 (Admin) (218,480 points)
But is is possible to retrieve the logs and find html tags/BB code. A feature like the forgotten FTF that show all logs with html tags/bb code and links to the log would be helpful.
And a auto converted html/bb -> Markdown text field that could be copied and pasted into gc.com could be useful. That might be problematic to do correctly when gc.com dont do that. But an simple auto convert and som warning text could be used

It will be interesting to se all old {*FTF*} text be renders as {FTF} with italic text and user names with two * or _ will also be incorrectly displayed
It would to some extent be possible. I don't think all tags will be possible, at least not easy. But html-hrefs or bbcode-urls should be for example.

About the FTF tag, if I were Groundspeak, I would only parse for Markdown on logs created after the set date. It will then not ruin old logs. But it will still be a problem on new ones of course. But I assume it's not a real problem, since the log will still be {*FTF*} in its raw format.
Try the test website staging.geocaching.com
you cant write {*FTF*} in a log it is not possible even {FTF}
The second } selects all text to the first { and dont add the character......
I just did on Staging. It worked fine (logged GC423AB with a note). The stars are gone in the log text, but when I press edit I still see the raw text {*FTF*}

UPDATE: After further discussions with Target (over IM) we have come to the conclusion that it works fine for me with Ubuntu+FF/Chrome. But not for him with Windows+FF/Chrome/Edge. Interesting...
The problem was that } is AltGr+0 on swedish keyboard and that registers as ctrl and alt and trigger the editor shortcuts for formating and sets H0(regular text format) and no } is added to the text
Could the greasemonkey script repair them visually and show a Repair Log link that puts the corrected text into the text area of an edit log page?
That would be an extremely big task for that script. Bigger than the rest of the script. But I have an alternative answer that I will post.
+4 votes
Groundspeak has made a tool to help users convert their logs:

https://support.groundspeak.com/index.php?pg=kb.page&id=740
answered Feb 15, 2016 by magma1447 (Admin) (218,480 points)
I've just used this to convert a couple of old logs - it seems to work well.

Is it possible for PGC to produce a list of caches where I've used html/BBCode in my logs? It'll be a big task, but easier than having to convert them.
It would be possible, partly. We could search logs for a list of specific strings like
[url
href=
<b>
[b]

and so on. The question is, would it be worth two days of work. Roughly said, if not a 100 users will change at least a 100 logs each, I personally don't think it's worth the effort.

But maybe we could make a quick and dirty hack in less than a day, then maybe we could consider it just for the PR.
http://project-gc.com/Tools/MarkdownIncompatibleLogs

If you know of any commonly used HTML or BBCode tags that we did not list, you are welcome to inform us.
Fantastic! Just what I needed.
...