readme: add syntax highlighting
This PR adds syntax highlighting to the readme. Thanks!
This commit is contained in:
parent
eedb722d7b
commit
5ca1801208
|
@ -33,7 +33,7 @@ OpenPGP.js uses ES6 promises which are available in [most modern browsers](http:
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
#### Encryption
|
#### Encryption
|
||||||
|
```js
|
||||||
var openpgp = require('openpgp');
|
var openpgp = require('openpgp');
|
||||||
var key = '-----BEGIN PGP PUBLIC KEY BLOCK ... END PGP PUBLIC KEY BLOCK-----';
|
var key = '-----BEGIN PGP PUBLIC KEY BLOCK ... END PGP PUBLIC KEY BLOCK-----';
|
||||||
var publicKey = openpgp.key.readArmored(key);
|
var publicKey = openpgp.key.readArmored(key);
|
||||||
|
@ -42,9 +42,10 @@ OpenPGP.js uses ES6 promises which are available in [most modern browsers](http:
|
||||||
}).catch(function(error) {
|
}).catch(function(error) {
|
||||||
// failure
|
// failure
|
||||||
});
|
});
|
||||||
|
```
|
||||||
|
|
||||||
#### Decryption
|
#### Decryption
|
||||||
|
```js
|
||||||
var openpgp = require('openpgp');
|
var openpgp = require('openpgp');
|
||||||
var key = '-----BEGIN PGP PRIVATE KEY BLOCK ... END PGP PRIVATE KEY BLOCK-----';
|
var key = '-----BEGIN PGP PRIVATE KEY BLOCK ... END PGP PRIVATE KEY BLOCK-----';
|
||||||
var privateKey = openpgp.key.readArmored(key).keys[0];
|
var privateKey = openpgp.key.readArmored(key).keys[0];
|
||||||
|
@ -56,7 +57,7 @@ OpenPGP.js uses ES6 promises which are available in [most modern browsers](http:
|
||||||
}).catch(function(error) {
|
}).catch(function(error) {
|
||||||
// failure
|
// failure
|
||||||
});
|
});
|
||||||
|
```
|
||||||
|
|
||||||
### Security recommendations
|
### Security recommendations
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user