File tree 2 files changed +12
-7
lines changed
host/app/components/ai-assistant
2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -33,16 +33,21 @@ export default class FormattedMessage extends Component<FormattedMessageSignatur
33
33
{{/if }}
34
34
35
35
<style scoped >
36
- .message {
37
- padding : var (--ai-assistant-message-padding , var (--boxel-sp ));
38
- }
39
-
40
36
/* code blocks can be rendered inline and as blocks,
41
37
this is the styling for when it is rendered as a block */
42
38
.message > :deep(.preview-code.code-block ) {
43
39
width : calc (100% + 2 * var (--boxel-sp ));
44
40
}
45
41
42
+ .message > :deep(* ) {
43
+ margin-top : 0 ;
44
+ margin-bottom : 0 ;
45
+ }
46
+
47
+ .message > :deep(* + * ) {
48
+ margin-top : var (--boxel-sp );
49
+ }
50
+
46
51
:deep(.preview-code ) {
47
52
--spacing : var (--boxel-sp-sm );
48
53
--fill-container-spacing : calc (
Original file line number Diff line number Diff line change 1
1
import { marked } from 'marked' ;
2
2
import { sanitizeHtml } from './dompurify-runtime' ;
3
- import { v4 as uuidv4 } from 'uuid ' ;
3
+ import { md5 } from 'super-fast-md5 ' ;
4
4
5
5
const CODEBLOCK_KEY_PREFIX = 'codeblock_' ;
6
6
@@ -11,8 +11,8 @@ export function markedSync(markdown: string) {
11
11
// If you are relying on codeblocks in your
12
12
// markdown, please use the `CodeBlock` modifier to render the
13
13
// markdown.
14
- code ( code , language ) {
15
- let id = `${ CODEBLOCK_KEY_PREFIX } ${ uuidv4 ( ) } ` ;
14
+ code ( code , language = '' ) {
15
+ let id = `${ CODEBLOCK_KEY_PREFIX } ${ md5 ( Date . now ( ) + language + code ) } ` ;
16
16
// we pass the code thru using localstorage instead of in the DOM,
17
17
// that way we don't have to worry about escaping code. note that the
18
18
// DOM wants to render "<template>" strings when we put them in the
You can’t perform that action at this time.
0 commit comments