forked from cory/tildefriends
Show images inline.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3844 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -232,8 +232,7 @@ async function getRecentPostIds(db, id, ids, limit) {
|
||||
"WHERE "+
|
||||
" rowid > ? AND "+
|
||||
" rowid <= ? AND "+
|
||||
" author IN (" + ids_batch.map(x => '?').join(", ") + ") AND "+
|
||||
" json_extract(content, '$.type') = 'post' "+
|
||||
" author IN (" + ids_batch.map(x => '?').join(", ") + ") "+
|
||||
"ORDER BY timestamp DESC LIMIT ?",
|
||||
[].concat([f.rowid, row_id_max], ids_batch, [limit]),
|
||||
function(row) {
|
||||
|
@ -8,13 +8,19 @@ function markdown(md) {
|
||||
var event, node;
|
||||
while ((event = walker.next())) {
|
||||
node = event.node;
|
||||
if (event.entering && node.type == 'link') {
|
||||
if (node.destination.startsWith('@') &&
|
||||
node.destination.endsWith('.ed25519')) {
|
||||
node.destination = '#' + node.destination;
|
||||
} else if (node.destination.startsWith('%') &&
|
||||
node.destination.endsWith('.sha256')) {
|
||||
node.destination = '#' + node.destination;
|
||||
if (event.entering) {
|
||||
if (node.type == 'link') {
|
||||
if (node.destination.startsWith('@') &&
|
||||
node.destination.endsWith('.ed25519')) {
|
||||
node.destination = '#' + node.destination;
|
||||
} else if (node.destination.startsWith('%') &&
|
||||
node.destination.endsWith('.sha256')) {
|
||||
node.destination = '#' + node.destination;
|
||||
}
|
||||
} else if (node.type == 'image') {
|
||||
if (node.destination.startsWith('&')) {
|
||||
node.destination = '/' + node.destination + '/view';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user