mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-02 16:21:32 -08:00
Add Blockquote to Each Selected Line - fixes #121
This commit is contained in:
parent
6762d9a87b
commit
22731c1d38
2 changed files with 6 additions and 2 deletions
|
@ -582,7 +582,11 @@ var DownArea = (function () {
|
|||
if (self.textarea.selectionStart != self.textarea.selectionEnd) {
|
||||
end = self.textarea.value.substr(self.textarea.selectionEnd);
|
||||
var range = self.textarea.value.slice(self.textarea.selectionStart, self.textarea.selectionEnd);
|
||||
blockquote = "".concat(blockquote).concat(range.trim());
|
||||
var lines = range.trim().split('\n');
|
||||
var modifiedLines = lines.map(function (line) {
|
||||
return "> " + line.trim();
|
||||
});
|
||||
blockquote = modifiedLines.join('\n') + '\n';
|
||||
}
|
||||
if (start.length && start[start.length - 1] != '\n') {
|
||||
blockquote = "\n".concat(blockquote);
|
||||
|
|
|
@ -246,7 +246,7 @@
|
|||
{% if post_layout == 'masonry' or post_layout == 'masonry_wide' %}
|
||||
<!-- -->
|
||||
{% endif %}
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='js/markdown/downarea.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='js/markdown/downarea.js', changed=getmtime('js/markdown/downarea.js')) }}"></script>
|
||||
{% endif %}
|
||||
{% if theme() and file_exists('app/templates/themes/' + theme() + '/scripts.js') %}
|
||||
<script src="{{ url_for('static', filename='themes/' + theme() + '/scripts.js') }}" />
|
||||
|
|
Loading…
Add table
Reference in a new issue