Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
cotw-fabier committed Jun 26, 2024
1 parent bcf583c commit 689caa0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
39 changes: 19 additions & 20 deletions packages/parchment/example/encoder_example.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:parchment/codecs.dart';
import 'package:parchment/parchment.dart';
import 'package:parchment/src/codecs/codec_extensions.dart';
import 'package:parchment_delta/parchment_delta.dart';

void main() {
Expand All @@ -19,33 +18,33 @@ void main() {
// We're going to do both an inline and a block embed. They are essentially the same except the inline property.
// Inline Block Embed
final youtubeInlineEmbedDelta = {
"_type": "youtube",
"_inline": true,
"url": url,
"title": "Read the Url Before Clicking",
"language": "en",
"thumbUrl": thumbUrl
'_type': 'youtube',
'_inline': true,
'url': url,
'title': 'Read the Url Before Clicking',
'language': 'en',
'thumbUrl': thumbUrl
};

// Block Embed
final youtubeBlockEmbedDelta = {
"_type": "youtube",
"_inline": false,
"url": url,
"title": "Read the Url Before Clicking",
"language": "en",
"thumbUrl": thumbUrl
'_type': 'youtube',
'_inline': false,
'url': url,
'title': 'Read the Url Before Clicking',
'language': 'en',
'thumbUrl': thumbUrl
};

// Lets create new Delta to insert content into our document.
final newDelta = Delta()
..insert(
'Lets add in some examples of custom embed blocks which we\'ll implement custom encoders to encode the result.')
..insert("\n")
..insert("Lets Start with a simple inline block: ")
..insert('\n')
..insert('Lets Start with a simple inline block: ')
..insert(youtubeInlineEmbedDelta)
..insert("\n")
..insert("Now lets add a block embed: \n")
..insert('\n')
..insert('Now lets add a block embed: \n')
..insert(youtubeBlockEmbedDelta);

// Since we know our changes are progormatically generated they don't need to be run through Heuristics and Autoformatting.
Expand Down Expand Up @@ -101,10 +100,10 @@ void main() {
ParchmentMarkdownCodec(extensions: encoderList).encode(doc);

// Lets print out our results.
print("HTML Output:");
print('HTML Output:');
print(htmlOutput);
print("\n\n");
print("Markdown Output:");
print('\n\n');
print('Markdown Output:');
print(markdownOutput);

// Congrats! You can now make all manner of awesome custom embeds and work with them like any other text.
Expand Down
1 change: 0 additions & 1 deletion packages/parchment/lib/src/codecs/codec_extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// Custom Encoder and Decoder functions run BEFORE the default encoder and decoder functions.
// This means you can override normal behavior of the default embed encoder if desired (really just for HR and image tags at this point).

import 'package:html/dom.dart';
import 'package:parchment/src/document/embeds.dart';

// Simple enum to allow us to write one encode class to encapsulate both Markdown and HTML encode extensions
Expand Down

0 comments on commit 689caa0

Please sign in to comment.