Все вопросы: [markdown]

89 вопросов

2
голосов
3ответов
920 просмотров

Тег шаблона Django для рендеринга подмножества html

У меня есть HTML-код (в данном случае созданный с помощью TinyMCE), который я хотел бы добавить на страницу.Однако из соображений безопасности я не хочу просто печатать все, что ввел пользователь. Кто-нибудь знает тег шаблона (желательно фильтр), который позволяет отображать только безопасное...

5
голосов
3ответов
3174 просмотров

Уценка Python: разметка внутри HTML-блоков

Есть ли дополнительная функция для Python Markdown, которая поддерживает Markdown внутри блочных элементов HTML, напримерdiv, p т.е.есть ли способ преобразовать это: <div id="content"> [Google](http://www.google.com) </div> в <div id="content"> <a href="...

11
голосов
5ответов
6022 просмотров

Markdown и XSS

Хорошо, поэтому я читал о уценке здесь, в SO и в других местах, и шаги между пользовательским вводом и базой данных обычно указываются как преобразовать уценку в HTML очистить HTML (с белым списком) вставить в базу данных но для меня имеет смысл сделать следующее: очистить уценку...

5
голосов
2ответов
198 просмотров

Вычислительная техника аннотаций статей

Я ищу способ автоматически создавать аннотацию, в основном первые несколько сообщений / абзацев записи в блоге, для отображения в списке статей (которые написаны с разметкой).Сейчас я делаю что-то вроде этого: def abstract(article, paras=3): return '\n'.join(article.split('\n')[0:paras]) ...

1
голосов
3ответов
365 просмотров

Запрос комментариев: каким должен быть синтаксис для включения фрагментов кода в Markdown? (из внешних файлов)

Недавно я использовал Markdown . Одна из самых больших проблем с Markdown заключается в том, что у Markdown нет синтаксиса для включения файлов в документ (по сравнению, скажем, с listings для LaTeX). Я хотел бы расширить Markdown для поддержки включения целых и частичных файлов в виде ...

3
голосов
1ответов
393 просмотров

Custom Markdown for PHP handling new lines

I need custom Markdown library for PHP which converts new lines to <br/> without the need to put double space on the end of the line, kinda like here on SO. I've been looking on the web but without success. I know I could just amend standard library but my regex skills are none. Does anyb...

1
голосов
2ответов
643 просмотров

Is it the best practice to store content in the database as html when content is written in markdown?

Or is just saving markdown and rendering it on requests usually okay? I'm writing a site that uses markdown for content. Stack overflow similarly uses markdown for comments and questions. I'm storing the content as markdown in the database and then rendering it to html when the user visits the ...

1
голосов
3ответов
570 просмотров

How make a better markdown for developer blog

I'm rebuilding my blog at http://www.elmalabarista.com/blog/. I have use in my previous version markdown and now I remember why I have almost zero code samples. Doing code samples in markdown is very fragile. I try to put some python there I can't make markdown mark it as code!. The main culprit...

1
голосов
3ответов
935 просмотров

What's a good syntax for an HTML link markdown to make internal links easier?

I want to create a good syntax for making it easier to link to internal things, kind of like a Wiki, so maybe I'm thinking the user can use something like: Bah bah bah reference: [[a]] And it would convert it into HTML: Bah bah bah reference: <a href="..../id=a">title</a> but I'...

4
голосов
1ответов
900 просмотров

Markdown And Escaping Javascript Line Breaks

I am writing a markdown compiler in Erlang for server-side use. Because it will need to work with clients I have decided to adopt the client side library (showdown.js) as the specification and then test my code for compatibility with that. In the first couple of iterations I built up 260-odd uni...

33
голосов
4ответов
12487 просмотров

How to zip a WordprocessingML folder into readable docx

I have been trying to write a simple Markdown -> docx parser/writer, but am completely stuck with the last part, which should be the easiest: i.e. compressing the folder into a .docx that Word, or any other .docx reader, will recognize. My parser-writer is irrelevant really: I have this pr...

0
голосов
2ответов
474 просмотров

javascript showdown, markdown not parsing correctly

I have a confusing problem. I have two files, both that run showdown. However, it seems that only one file parses correctly. Here's the deal. File 1 is run through PHP and AJAX. File 2 is grabbed via an AJAX request. The file that processes the ajax request contains this code. Here is the ajax As...

1
голосов
1ответов
1702 просмотров

Django & markdown issue: 'NoneType' object has no attribute 'strip'

I have a problem about markdown and django integration. After I installed markdown and change my model class to: class Page(models.Model): class Translation(multilingual.Translation): title = models.CharField(verbose_name="Title", max_length=30, help_...

24
голосов
6ответов
11431 просмотров

What is the simplest implementation of Markdown for a Cocoa application?

I'm writing a Cocoa application in Objective-C, and I would like to be able to incorporate Markdown. The user will enter text in Markdown syntax, click an "export" button, and the program will output a file of XHTML. It seems like there are a lot of options, though. I could use one of the C/C++ ...

0
голосов
2ответов
98 просмотров

How do I know if I need to use a Markdown library?

I've been finding that a lot of Github projects use Markdown. I originally thought this library was only needed on sites like StackOverflow that include the ability for users to add comments or posts that might include source code snippets. But some apps seem to use Markdown even when this is not...

7
голосов
3ответов
2419 просмотров

Sanitize Markdown in Rails?

Users can edit "articles" in my application. Each article is mastered in the DB and sent to the client as Markdown -- I convert it to HTML client side with Javascript. I'm doing this so that when the user wants to edit the article he can edit and POST the Markdown right back to the server (since...

7
голосов
3ответов
2190 просмотров

MarkItUp! continuous preview refresh without hitting enter

I'm using MarkItUp (http://markitup.jaysalvat.com/) and can't really figure out how to get it to continuously update the preview pane as each character is typed (or even when a 'space' is encountered). By default it refreshes the preview pane only when the enter key is hit. Is there any way to ...

0
голосов
1ответов
680 просмотров

Loading Markdownify in CodeIgniter

I downloaded Markdownify from http://milianw.de/projects/markdownify/ and extracted it to my application/libraries/ directory. I did a: $this->load->library('markdownify'); echo $this->markdownify->parseString('<b>Test</b>'); But the output is the same html markup. It ...

84
голосов
11ответов
66321 просмотров

Javascript to convert Markdown/Textile to HTML (and, ideally, back to Markdown/Textile)

There are several good Javascript editors for Markdown / Textile (e.g.: http://attacklab.net/showdown/, the one I'm using right now), but all I need is a Javascript function that converts a string from Markdown / Textile -> HTML and back. What's the best way to do this? (Ideally it would be j...

6
голосов
2ответов
312 просмотров

What's the easiest way to convert an SO data dump from HTML back to Markdown?

I've just got my hands on a Stackoverflow data dump, and I'm disappointed to see that the Body field of the posts is in HTML rather than Markdown. I suspect there's Markdown in the original database because that's what I see if I try to edit an answer. I want to recover Markdown from a large se...

11
голосов
3ответов
3243 просмотров

Should i sanitize markdown?

For my post entity i store both HTML and MARKDOWN in database (HTML is converted from MARKDOWN). HTML is for rendering on page and MARKDOWN for editing ability (with WMD). I sanitize HTML before storing to db. Question is: should i sanitize markdown too? or it is xss-safe if i only pass it to wmd...

2
голосов
4ответов
989 просмотров

How to switch web app from HTML to Markdown?

I've got a django-powered site. Currently, all of the textfields are just plain old text inputs that take raw HTML. I have no fancy editor or anything. I would like to start using Markdown and WMD to make things easier for everyone. Do I have to run some sort of script to go over every text fie...

11
голосов
7ответов
2851 просмотров

Is Markdown (with strip_tags) sufficient to stop XSS attacks?

I'm working on a web application that allows users to type short descriptions of items in a catalog. I'm allowing Markdown in my textareas so users can do some HTML formatting. My text sanitization function strips all tags from any inputted text before inserting it in the database: public funct...

5
голосов
2ответов
2779 просмотров

Syntax highlighting with Markdown & Pygments in Django

I've been trying to get syntax highlighting working in my simple Django (1.1) test app using Markdown (2.0.1) & Pygments (1.0). The idea is to generate HTML from the users input which is in markdown format and store both in the DB so I don't have to do the markdown to html translation during...

1
голосов
1ответов
549 просмотров

multiple wmd textareas on the same page

I'm trying to use the wmd markdown text editor for my site. I have two textareas on my page and I need the wmd editor for both. By default, it assigned it only to the first texarea, but how do I apply it to both textareas? Also, I always get an extra new line at the end of my markedup text tha...

9
голосов
4ответов
3587 просмотров

WMD markdown editor - HTML to Markdown conversion

I am using wmd markdown editor on a project and had a question: When I post the form containing the markdown text area, it (as expected) posts html to the server. However, say upon server-side validation something fails and I need to send the user back to edit their entry, is there anyway to re...

1
голосов
2ответов
703 просмотров

wmd - markdown editor - how to assign it to an arbitrary text field?

If any of you have ever used wmd markdown editor (which is like the editor that stackoverflow uses) then maybe you are able to help me out: WMD by default assigns itself to the first textarea found on the page. However, I have a page with an arbitrary amount of textareas appearing before the o...

1
голосов
2ответов
974 просмотров

To change TYPE to nothing from conf in Vim

My syntax -highlighting is broken for a file which Type is conf as follows: File where the syntax highlighting does not work alt text http://files.getdropbox.com/u/175564/bugs/vim-bug-type.png The syntax highlighting works for all other files with the extension .markdown. However, the only dif...

2
голосов
1ответов
336 просмотров

WMD Markdown and server-side

I have worked the last 2 days on WMD and Markdown, and I don't find THE solution for stock data with security. I would like users to be able to post HTML/XML (with WMD) on my site. For the moment, I stock data in the Markdown format, but if I disable JavaScript the user can easily push XSS. If...

8
голосов
2ответов
1117 просмотров

What are my options for working with markdown in ColdFusion?

I am seeing many many different use cases where I could use Markdown in apps that I write, both personal and professional. But from my research so far, I haven't been able to find many options for working with it in ColdFusion. I would certainly like to keep from reinventing the wheel by trying...