我正在尝试使用自定义 Blot 来扩展 Quill,以允许标签内换行<p>。根据库作者给出的建议,我最终得到了如下所示的代码:
import * as Quill from 'quill';
const Delta = Quill.import('delta');
const Embed = Quill.import('blots/embed');
export class SoftLineBreakBlot extends Embed {
    static blotName = 'softbreak';
    static tagName = 'br';  
    static className = 'softbreak';
}
export function shiftEnterHandler(this: any, range) {    
    const currentLeaf = this.quill.getLeaf(range.index)[0];
    const nextLeaf = this.quill.getLeaf(range.index + 1)[0];    
    this.quill.insertEmbed(range.index, "softbreak", true, Quill.sources.USER);    
    // Insert a second break if:
    // At the end of the editor, OR next leaf has a different …Run Code Online (Sandbox Code Playgroud) 是否有人成功.csproj为使用新的SDK样式.csproj格式的UWP项目创建了文件?我从有关WPF的问题中汲取了灵感,这使我90%地了解了WPF。
之后,我开始使用MSBuild.Sdk.Extras程序包,该程序包使我可以uap10.0作为进行访问<TargetFramework>,经过一些调整后,我实际上使用以下程序进行编译.csproj:
<Project Sdk="MSBuild.Sdk.Extras">
  <PropertyGroup>    
    <!--UWP-specific properties-->        
    <TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.17134.0</TargetPlatformVersion>
    <TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>
    <TargetFrameworks>uap10.0</TargetFrameworks>
    <OutputType>AppContainerExe</OutputType>    
    <LanguageTargets>$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets</LanguageTargets>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <PackageCertificateKeyFile>Test.UWP_TemporaryKey.pfx</PackageCertificateKeyFile>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)'=='Debug'">
    <OutputPath>bin\x86\Debug\</OutputPath>
    <DebugType>full</DebugType>
    <PlatformTarget>x86</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)'=='Release'">
    <OutputPath>bin\x86\Release\</OutputPath>
    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
    <Optimize>true</Optimize>
    <PlatformTarget>x86</PlatformTarget>
    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
  </PropertyGroup>  
  <ItemGroup>    
    <!--XAML stuff-->
    <ApplicationDefinition Include="App.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </ApplicationDefinition>
    <Page Include="**\*.xaml" Exclude="App.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>        
    <Compile Update="**\*.xaml.cs" SubType="Code" DependentUpon="%(Filename)" />
     <AppxManifest Include="Package.appxmanifest"> …Run Code Online (Sandbox Code Playgroud)