feat: Code blocks can now optionally display line numbers (#4324)

* feat: Code blocks can now optionally display line numbers as a user preference

* Touch more breathing room
This commit is contained in:
Tom Moor
2022-10-24 09:44:46 -04:00
committed by GitHub
parent 708f9a3fd6
commit 87761e9bf2
10 changed files with 103 additions and 20 deletions

View File

@@ -57,10 +57,12 @@ export type Props = Optional<
function Editor(props: Props, ref: React.RefObject<SharedEditor> | null) {
const { id, shareId, onChange, onHeadingsChange } = props;
const { documents } = useStores();
const { documents, auth } = useStores();
const { showToast } = useToasts();
const dictionary = useDictionary();
const embeds = useEmbeds(!shareId);
const preferences = auth.user?.preferences;
const [
activeLinkEvent,
setActiveLinkEvent,
@@ -286,6 +288,7 @@ function Editor(props: Props, ref: React.RefObject<SharedEditor> | null) {
uploadFile={onUploadFile}
onShowToast={showToast}
embeds={embeds}
userPreferences={preferences}
dictionary={dictionary}
{...props}
onHoverLink={handleLinkActive}