777 """This compound field allow edition of binary stream as |
777 """This compound field allow edition of binary stream as |
778 :class:`~cubicweb.web.formfields.FileField` but expect that stream to |
778 :class:`~cubicweb.web.formfields.FileField` but expect that stream to |
779 actually contains some text. |
779 actually contains some text. |
780 |
780 |
781 If the stream format is one of text/plain, text/html, text/rest, |
781 If the stream format is one of text/plain, text/html, text/rest, |
|
782 text/markdown |
782 then a :class:`~cubicweb.web.formwidgets.TextArea` will be additionaly |
783 then a :class:`~cubicweb.web.formwidgets.TextArea` will be additionaly |
783 displayed, allowing to directly the file's content when desired, instead |
784 displayed, allowing to directly the file's content when desired, instead |
784 of choosing a file from user's file system. |
785 of choosing a file from user's file system. |
785 """ |
786 """ |
786 editable_formats = ('text/plain', 'text/html', 'text/rest') |
787 editable_formats = ( |
|
788 'text/plain', 'text/html', 'text/rest', 'text/markdown') |
787 |
789 |
788 def render(self, form, renderer): |
790 def render(self, form, renderer): |
789 wdgs = [super(EditableFileField, self).render(form, renderer)] |
791 wdgs = [super(EditableFileField, self).render(form, renderer)] |
790 if self.format(form) in self.editable_formats: |
792 if self.format(form) in self.editable_formats: |
791 data = self.typed_value(form, load_bytes=True) |
793 data = self.typed_value(form, load_bytes=True) |