Possible to handle line turn char ?

This command cThis will be the only\nlines in the document. should give this document

This will be the only
lines in the document.

but it gives

This will be the only\nlines in the document.

This would allow diff -e generated command to be almost twinwiki compatible and simplify a lot scripting page editors :D

Stacy Harper
Assigned to
2 years ago
2 years ago
No labels applied.

~dancek 2 years ago

This is an interesting idea! I actually went and wrote a unit test for that, expecting to implement it after the test fails. But the test passed; the implementation already supports newlines in commands.

I tried editing the vimwiki test instance using amfora. As you said, typing \n in the input does not result in a newline. But then that's quite obvious, because the input doesn't support escaping. Rather its text is URL encoded as is, and so \ becomes %5C and thus \n is encoded %5Cn.

Now, of course the newline can be url encoded too. It is %0A. So running the command

gemget -o- 'gemini://hannuhartikainen.fi/twinwiki/test/_edit?cLorem%20ipsum%0Adolor%20sit%0Aamet'

results in the document content becoming

Lorem ipsum
dolor sit

as expected.

Of course, clients with any kind of an UI will probably not support this. But they could.

Does this help?

Stacy Harper 2 years ago · edit

Oh ! You right !

My code was that buggy that I though the issue was from the wiki api.

I'm trying hard to transform this diff -e to a list of url encoded inputs to give to the api, in posix shell :D I'll make it work but I dunno when…

I really think we could use your work on twinwiki and build a simple client to write pages with ease :)

Register here or Log in to comment, or comment via email.